Bug 803778

Summary: subscription-manager modules with --servicelevel option should be ignored against older candlepin
Product: Red Hat Enterprise Linux 6 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Michael Stead <mstead>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3CC: bkearney, mstead, skallesh, spandey
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:07:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 738066    

Description John Sefler 2012-03-15 15:55:16 UTC
Description of problem:
Based on sprint 40 planning, newer client functionality should fail gracefully against older candlepin servers

All of the subscription-manager modules that allow a --servicelevel option should echo to stdout a friendly message stating something like this:
"Option --servicelevel will be ignored when communicating to a candlepin server that does not support this feature."

This affects the following modules:
[root@hp-xw9300-01 ~]# subscription-manager register --help | grep servicelevel
  --servicelevel=SERVICE_LEVEL
[root@hp-xw9300-01 ~]# subscription-manager subscribe --help | grep servicelevel
  --servicelevel=SERVICE_LEVEL
And will soon affect the subscription-manager list module


Version-Release number of selected component (if applicable):
[root@hp-xw9300-01 ~]# rpm -q subscription-manager
subscription-manager-0.99.9-1.el6.x86_64


How reproducible:


Steps to Reproduce:
deploy an older candlepin server (than 0.5.5 ish?)
configure client to use the older candlepin and register etc...



# subscription-manager subscribe --auto --servicelevel="foo"
Service level set to: foo
Installed Product Current Status:
ProductName:          	Red Hat Enterprise Linux Server
Status:               	Subscribed               

^^^
In this case the servicelevel of "foo" was clearly ignored because there is no servicelevel checking by the old candlepin server, therefore we should echo to stdout that this option is being ignored.

Comment 1 John Sefler 2012-03-15 15:58:26 UTC
Same issue with register module...

# subscription-manager register --username qa --autosubscribe --servicelevel=foo
Password: 
The system has been registered with id: 26b57605-1902-48e5-bd6a-65648f773682 
Service level set to: foo
Installed Product Current Status:
ProductName:          	Red Hat Enterprise Linux Server
Status:               	Subscribed               

^^^
Again the servicelevel of "foo" was clearly ignored because there is no
servicelevel checking by the old candlepin server, therefore we should echo to
stdout that this option is being ignored.

Comment 2 Michael Stead 2012-03-20 15:23:25 UTC
The list command does the filtering by service level client-side, and since subscriptions already have the 'support_level' property, it will work on older versions of candlepin.

Should it error out for consistency, or should we leave it be?

My vote would be to leave it as is.

Comment 3 Bryan Kearney 2012-03-20 15:42:17 UTC
+1 to leave it as is.

Comment 4 Michael Stead 2012-03-21 14:17:26 UTC
The main fix was done in commit 05dedb4b94d19fc435b7505188977390badabaaa which gracefully handles missing API call.

Messages were updated in commits in master branch:
68224fda443f2103c22ecc2c677d0f4539914752
6d24ee715e18a4625325125203b7b86136ce0b18

Available in subscription-manager-0.99.11-1+

Comment 5 Michael Stead 2012-03-21 14:18:22 UTC
As per comment 2, the list command was left as is. It should work fine on older candlepin.

Comment 8 Shwetha Kallesh 2012-03-26 11:49:23 UTC
Verfied against following RPM

[root@skallesh ~]# rpm -qa | grep subscription-manager
subscription-manager-debuginfo-0.99.12-1.el6.x86_64
subscription-manager-gnome-0.99.12-1.el6.x86_64
subscription-manager-0.99.12-1.el6.x86_64
subscription-manager-migration-0.99.12-1.el6.x86_64
subscription-manager-firstboot-0.99.12-1.el6.x86_64
subscription-manager-migration-data-1.12.1.1-1.git.6.ea6813e.el6.noarch


[root@skallesh ~]# subscription-manager subscribe --auto --servicelevel="foo"
ERROR: The --servicelevel option is not supported by the server. Did not perform autosubscribe.
[root@skallesh ~]# subscription-manager unregister
System has been un-registered.
[root@skallesh ~]# subscription-manager register --auto --servicelevel="foo"
Username: stage_test_1
Password: 
The system has been registered with id: e1b4fcb6-3bdc-4ea1-b910-0546185f1260 
ERROR: The --servicelevel option is not supported by the server. Did not perform autosubscribe.

Comment 10 errata-xmlrpc 2012-06-20 13:07:18 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.

http://rhn.redhat.com/errata/RHBA-2012-0804.html