Bug 1466185

Summary: Changing service level from subscription manager does not make changes on WebUI
Product: Red Hat Satellite Reporter: Amit Upadhye <aupadhye>
Component: Subscription ManagementAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED ERRATA QA Contact: Walden Raines <walden>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.10CC: bbuckingham, bkearney, jcallaha, walden
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.4.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:51:07 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 Amit Upadhye 2017-06-29 08:36:00 UTC
Description of problem:

After changing service level using subscription manager it does not make any changes on Content Host profile on WebUI.

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

6.2.10

How reproducible:

Everytime

Steps to Reproduce:
1. Register a system on Satellite using subscription-manager.
2. Set Premium as service level on content host profile.
3. Unset service level from client system,

# subscription-manager service-level --unset 
Service level preference has been unset

This makes no changes on WebUI.

Actual results:

Service level does not change on Content Host system profile.

Expected results:

Service level changes should be reflected on WebUI for Content Hosts page.

Additional info:

1. On Satellite if I manually update service_level using subscription_facet then I can see it changes on Content Hosts page.

# vim /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.137/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb

247     def facts
248       User.current = User.anonymous_admin
249       async_task(::Actions::Katello::Host::Update, @host, rhsm_params)
250       Rails.logger.info("amit debug: #{rhsm_params[:serviceLevel]}")
251       @host.subscription_facet[:service_level] = rhsm_params[:serviceLevel]
252       @host.subscription_facet.save!
253       #Katello::Host::SubscriptionFacet.update_facts(@host, rhsm_params)
254       render :json => {:content => _("Facts successfully updated.")}, :status => 200
255     end

2. On upstream Foreman instance if I try to unset service level then it fails as below,

2017-06-29 14:02:59 ba103d50 [app] [I] Processing by Katello::Api::Rhsm::CandlepinProxiesController#facts as JSON
2017-06-29 14:02:59 ba103d50 [app] [I]   Parameters: {"serviceLevel"=>"", "id"=>"32584679-f348-4349-a711-a7f8b472758f"}
2017-06-29 14:02:59 ba103d50 [foreman-tasks/dynflow] [W] Error on on_execution_plan_save event
 | ActiveRecord::RecordInvalid: Validation failed: Resource can't be blank

http://pastebin.test.redhat.com/498781

Comment 1 Brad Buckingham 2017-07-10 17:25:14 UTC
Created redmine issue http://projects.theforeman.org/issues/20266 from this bug

Comment 2 Satellite Program 2017-07-18 16:07:17 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20266 has been resolved.

Comment 3 Satellite Program 2017-08-03 22:09:10 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20266 has been resolved.

Comment 4 Walden Raines 2017-08-16 21:05:11 UTC
I now see the service level being removed when running:

subscription-manager service-level --unset 

on sat 6.3.0 snap 11.

Comment 5 Satellite Program 2018-02-21 16:51:07 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> 
> For information on the advisory, and where to find the updated files, follow the link below.
> 
> If the solution does not work for you, open a new bug report.
> 
> https://access.redhat.com/errata/RHSA-2018:0336