Bug 1479933 - Unable to reset host repository set repos to default state
Unable to reset host repository set repos to default state
Status: NEW
Product: Red Hat Satellite 6
Classification: Red Hat
Component: API - Content (Show other bugs)
6.3.0
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
Katello QA List
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-09 14:56 EDT by Jonathon Turel
Modified: 2018-05-07 01:24 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathon Turel 2017-08-09 14:56:41 EDT
Description of problem:

It's not possible to reset the state (enablement) of a repo once it's been altered.

Example URL: /content_hosts/2/products?page=1&per_page=20


Version-Release number of selected component (if applicable):


How reproducible: Seemingly always


Steps to Reproduce:
1. Register a host and attach a subscription w/ a product such as RHEL 7 Server
2. The repo is probably enabled by default - so disable it
3. Attempt to use the Reset to Default option of the action dropdown to set it back to enabled

Actual results:

The repo state is unchanged, error coming up in the UI reads: ["uninitialized constant Katello::Foreman::Cast"]


Expected results: No error and for the repo to be set to its default state - enabled in my example.


Additional info:

Useful bit of the stack trace: 

2017-08-09 18:50:11 8768de57 [app] [I] Started PUT "/api/v2/hosts/2/subscriptions/content_override" for 192.168.121.1 at 2017-08-09 18:50:11 +0000
2017-08-09 18:50:11 8768de57 [app] [I] Processing by Katello::Api::V2::HostSubscriptionsController#content_override as JSON                                                                                        
2017-08-09 18:50:11 8768de57 [app] [I]   Parameters: {"content_overrides"=>[{"content_label"=>"rhel-7-server-rpms", "name"=>"enabled", "value"=>"[FILTERED]", "remove"=>true}], "api_version"=>"v2", "host_id"=>"2"
, "host_subscription"=>{"content_overrides"=>[{"content_label"=>"rhel-7-server-rpms", "name"=>"enabled", "value"=>"[FILTERED]", "remove"=>true}]}}
2017-08-09 18:50:11 8768de57 [app] [I] Current user: admin (administrator)                                    
2017-08-09 18:50:11 8768de57 [app] [E] NameError: uninitialized constant Katello::Foreman::Cast                                                                                                                    
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_hooks-0.3.14/lib/foreman_hooks/as_dependencies_hook.rb:4:in `load_missing_constant'                                                                        
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.4/app/controllers/katello/concerns/api/v2/content_overrides_controller.rb:10:in `validate_content_overrides_enabled'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.4/app/controllers/katello/api/v2/host_subscriptions_controller.rb:162:in `block in content_override'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.4/app/controllers/katello/api/v2/host_subscriptions_controller.rb:161:in `map'                                                                         
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.4/app/controllers/katello/api/v2/host_subscriptions_controller.rb:161:in `content_override'
Comment 1 Jonathon Turel 2017-08-09 14:59:07 EDT
This occurred in Sat 6.3 Snap 10 - satellite-6.3.0-16.0.beta.el7sat.noarch

Note You need to log in before you can comment on or make changes to this bug.