RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 812971 - subscription-manager cli is no longer autosubscribing the old way (without a service-level set)
Summary: subscription-manager cli is no longer autosubscribing the old way (without a ...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Devan Goodwin
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks: 738066
TreeView+ depends on / blocked
 
Reported: 2012-04-16 17:09 UTC by John Sefler
Modified: 2012-04-17 15:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-17 15:27:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description John Sefler 2012-04-16 17:09:53 UTC
Description of problem:
Using the cli only, the original autosubscribe behavior (that does not account for service-levels) is no longer working.


Version-Release number of selected component (if applicable):
[root@jsefler-r63-server ~]# rpm -q subscription-manager
subscription-manager-0.99.14-1.el6.x86_64


How reproducible:


Steps to Reproduce:
[root@jsefler-r63-server ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:         	Awesome OS Server Bits   
Product ID:           	37060                    
Version:              	6.1                      
Arch:                 	ALL                      
Status:               	Not Subscribed           
Starts:               	                         
Expires:              	                         

[root@jsefler-r63-server ~]# subscription-manager register --username testuser1 --password password --org admin --autosubscribe
The system has been registered with id: 7553f4dc-55ff-4a47-8c7b-27a71f94ce62 
Installed Product Current Status:
Product Name:         	Awesome OS Server Bits   
Status:               	Not Subscribed           

^^^^ EXPECTED "Subscribed" REGARDLESS OF SERVICE LEVEL. SINCE ONE WAS NOT SET GIVE ME ANY SERVICE LEVEL AS WAS DONE THE OLD WAY.

[root@jsefler-r63-server ~]# subscription-manager service-level
Current service level: 
[root@jsefler-r63-server ~]# 

[root@jsefler-r63-server ~]# curl -k -u testuser1:password --stderr /dev/null https://jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin/consumers/7553f4dc-55ff-4a47-8c7b-27a71f94ce62 | python -m simplejson/tool | grep serviceLevel
    "serviceLevel": "", 
[root@jsefler-r63-server ~]# 

^^^ IT APPEARS THAT serviceLevel IS SET TO "" BY DEFAULT AND THEREFORE DOES NOT MATCH ANY SUBSCRIPTION.  THIS IS WHY THE AUTOSUBSCRIBE IS NOT SUCCEEDING.  THIS WAS NOT THE CASE A FEW BUILDS AGO WHERE serviceLevel WAS null AND AUTOSUBSCRIBE WORKED THE OLD WAY.


[root@jsefler-r63-server ~]# subscription-manager register --username testuser1 --password password --org admin --autosubscribe --servicelevel=Standard --force
The system with UUID 7553f4dc-55ff-4a47-8c7b-27a71f94ce62 has been unregistered
The system has been registered with id: a8469342-49c6-43bf-96d5-f09f258be198 
Service level set to: Standard
Installed Product Current Status:
Product Name:         	Awesome OS Server Bits   
Status:               	Subscribed               

^^^ NOTICE THAT AUTO-SUBSCRIBE WORKS, BUT FIRST THE SERVICE LEVEL NEEDS TO BE SET.


IS THIS WHAT WE WANT?  WHAT IF THERE WAS NO SERVICE LEVEL SET ON THE AVAILABLE SUBSCRIPTIONS, THEN AUTOSUBSCRIBE MAY NOT WORK AT ALL SINCE THE CONSUMER'S DEFAULT SERVICE LEVEL OF "" WOULD NOT MATCH null.


What do you think?  Should the default serviceLevel attribute on the consumer be null or ""?  I think "" better mimics the new GUI behavior while null gives the CLI user the best of the old and new.

Comment 1 Devan Goodwin 2012-04-17 14:43:06 UTC
"" is the correct value for "no service level", it is handled in the rules and when seen, we skip all SLA filtering.

This use case is working fine here with the same test data:

root@redhat ~) $ subscription-manager register --username=testuser1 --password=password --force --autosubscribe --org=admin
The system has been registered with id: 4102abf4-87f1-4139-95c1-1003958d9a5d 
Installed Product Current Status:
Product Name:           Awesome OS Server Bits   
Status:                 Subscribed               

Working with John to see if we can figure out why it was not working in his case.

Comment 2 John Sefler 2012-04-17 15:27:29 UTC
Re-testing with versions....
[root@jsefler-f14-candlepin candlepin]# git show-ref | grep master
82216d9e5e38fe3d2d62d7d9860cc3d346832919 refs/heads/master
82216d9e5e38fe3d2d62d7d9860cc3d346832919 refs/remotes/origin/master

[root@jsefler-r63-server tmp]# rpm -q subscription-manager
subscription-manager-0.99.14-1.el6.x86_64



[root@jsefler-r63-server tmp]# subscription-manager register --username testuser1 --password password --org admin --autosubscribe --force --servicelevel Premium
The system with UUID 31237897-fde8-4a15-82a1-7f489e6e1256 has been unregistered
The system has been registered with id: 70ad6692-3ca5-477c-b51c-35295b05ae4e 
Service level set to: Premium
Installed Product Current Status:
Product Name:         	Awesome OS Server Bits   
Status:               	Subscribed               

[root@jsefler-r63-server tmp]# subscription-manager list --consumed | grep "Service Level"
Service Level:        	Premium                  
Service Level:        	Premium                  
Service Level:        	Premium                  
Service Level:        	Premium                  
Service Level:        	Premium                  
Service Level:        	Premium                  
[root@jsefler-r63-server tmp]# subscription-manager register --username testuser1 --password password --org admin --autosubscribe --force --servicelevel Standard
The system with UUID 70ad6692-3ca5-477c-b51c-35295b05ae4e has been unregistered
The system has been registered with id: 4745e3b0-5cbf-46ae-9a1f-eca534c6be94 
Service level set to: Standard
Installed Product Current Status:
Product Name:         	Awesome OS Server Bits   
Status:               	Subscribed               

[root@jsefler-r63-server tmp]# subscription-manager list --consumed | grep "Service Level"
Service Level:        	Standard                 
Service Level:        	Standard                 
Service Level:        	Standard                 
Service Level:        	Standard                 
Service Level:        	Standard                 
Service Level:        	Standard                 
[root@jsefler-r63-server tmp]# subscription-manager register --username testuser1 --password password --org admin --autosubscribe --force --servicelevel None
The system with UUID 4745e3b0-5cbf-46ae-9a1f-eca534c6be94 has been unregistered
The system has been registered with id: 873f892a-2c69-4cf8-89cd-8cbfb6e7e002 
Service level set to: None
Installed Product Current Status:
Product Name:         	Awesome OS Server Bits   
Status:               	Subscribed               

[root@jsefler-r63-server tmp]# subscription-manager list --consumed | grep "Service Level"
Service Level:        	None                     
[root@jsefler-r63-server tmp]# subscription-manager register --username testuser1 --password password --org admin --autosubscribe --force
The system with UUID 873f892a-2c69-4cf8-89cd-8cbfb6e7e002 has been unregistered
The system has been registered with id: c92af7bd-5696-419b-ad67-408bb0914f8f 
Installed Product Current Status:
Product Name:         	Awesome OS Server Bits   
Status:               	Subscribed               

[root@jsefler-r63-server tmp]# subscription-manager service-level
Current service level: 
[root@jsefler-r63-server tmp]# subscription-manager list --consumed | grep "Service Level"
Service Level:        	Premium                  
Service Level:        	Premium                  
Service Level:        	Premium                  
Service Level:        	Premium                  
Service Level:        	Premium                  
Service Level:        	Premium  
[root@jsefler-r63-server tmp]# subscription-manager register --username testuser1 --password password --org admin --force --autosubscribe
The system with UUID c92af7bd-5696-419b-ad67-408bb0914f8f has been unregistered
The system has been registered with id: e3db9341-194f-46d3-8630-26288c1c9ece 
Installed Product Current Status:
Product Name:         	Awesome OS Server Bits   
Status:               	Subscribed               

[root@jsefler-r63-server tmp]# subscription-manager service-level
Current service level: 
[root@jsefler-r63-server tmp]# subscription-manager list --consumed | grep "Service Level"
Service Level:        	None 
[root@jsefler-r63-server tmp]# subscription-manager register --username testuser1 --password password --org admin --autosubscribe --force
The system with UUID e3db9341-194f-46d3-8630-26288c1c9ece has been unregistered
The system has been registered with id: 76db1e84-5fe9-4c1e-8e10-c2446a0800a2 
Installed Product Current Status:
Product Name:         	Awesome OS Server Bits   
Status:               	Subscribed               

[root@jsefler-r63-server tmp]# subscription-manager service-level
Current service level: 
[root@jsefler-r63-server tmp]# subscription-manager list --consumed | grep "Service Level"
Service Level:        	Premium                  
Service Level:        	Premium                  
Service Level:        	Premium                  
Service Level:        	Premium                  
Service Level:        	Premium                  
Service Level:        	Premium  


^^^ VERIFIED:  The last three cases above all exercised autosubscribe without specifying a service level and the all successfully consumed an entitlement that provided for the installed product.  (interestingly the service level chosen was not always repeated, but that's okay since we did not specify the service level).

Moving to CLOSED WORKSFORME - not sure why the comment 0 failure occurred.  The subscription-manager version is identical, but I did redeploy the candlepin server.


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