Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1479933

Summary: Unable to reset host repository set repos to default state
Product: Red Hat Satellite Reporter: Jonathon Turel <jturel>
Component: API - ContentAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, jcallaha
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-04 17:45:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathon Turel 2017-08-09 18:56:41 UTC
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 18:59:07 UTC
This occurred in Sat 6.3 Snap 10 - satellite-6.3.0-16.0.beta.el7sat.noarch

Comment 3 Bryan Kearney 2018-09-04 17:45:34 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.