Bug 842170 - list --consumed should not substitute "None" for null support level and type
Summary: list --consumed should not substitute "None" for null support level and type
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager
Version: 5.9
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Adrian Likins
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: 771748
TreeView+ depends on / blocked
 
Reported: 2012-07-22 18:40 UTC by John Sefler
Modified: 2013-01-08 03:57 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Incorrect logic in the subscription-manager program. Consequence: "None" was being printed for service levels where an empty string should have been printed instead. Fix: Correcting the logic to recognize that an empty string represents a valid service level. Result: The empty string will now be printed for the service level if appropriate.
Clone Of:
Environment:
Last Closed: 2013-01-08 03:57:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0033 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2013-01-08 08:38:27 UTC

Description John Sefler 2012-07-22 18:40:50 UTC
Description of problem:
Currently when there is no value found in the entitlement cert for the support level and type in an order namespace, the subscription-manager list --consumed will substitute a "None" value for these fields.  This is a bad idea since "None" could actually be a valid value.  Instead, just leave the fields blank.


Version-Release number of selected component (if applicable):
[root@jsefler-rhel59 ~]# rpm -q subscription-manager python-rhsm
subscription-manager-1.0.9-1.git.37.53fde9a.el5
python-rhsm-1.0.3-1.git.2.47dc8f4.el5


How reproducible:


Steps to Reproduce:
[root@jsefler-rhel59 ~]# subscription-manager register --username testuser1 --password password --org admin
The system has been registered with id: f8410c0b-e772-402e-b327-42ff36c11fa1 
[root@jsefler-rhel59 ~]# subscription-manager list --avail | grep awesomeos-virt-unlimited -B1 -A8
Subscription Name:    	Awesome OS with unlimited virtual guests
SKU:                  	awesomeos-virt-unlimited
Pool Id:              	8a90f81d38ac01420138ac0247290480
Quantity:             	10
Service Level:        	
Service Type:         	
Multi-Entitlement:    	No
Ends:                 	08/20/2013
Machine Type:         	physical

--
Subscription Name:    	Awesome OS with unlimited virtual guests
SKU:                  	awesomeos-virt-unlimited
Pool Id:              	8a90f81d38ac01420138ac0246c80478
Quantity:             	5
Service Level:        	
Service Type:         	
Multi-Entitlement:    	No
Ends:                 	08/20/2013
Machine Type:         	physical

^^^ NOTICE THAT THERE ARE NO VALUES FOR Service Level AND Service Type IN THE list--avail.  IN MY OPINION THIS IS ACCEPTABLE AND CORRECT.

[root@jsefler-rhel59 ~]# subscription-manager subscribe --pool 8a90f81d38ac01420138ac0246c80478
Successfully consumed a subscription for: Awesome OS with unlimited virtual guests
[root@jsefler-rhel59 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+

Subscription Name:    	Awesome OS with unlimited virtual guests
Provides:             	Awesome OS Server Bits
SKU:                  	awesomeos-virt-unlimited
Contract:             	108
Account:              	12331131231
Serial Number:        	1202756969050095708
Active:               	True
Quantity Used:        	1
Service Level:        	None
Service Type:         	None
Starts:               	06/20/2012
Ends:                 	08/20/2013


^^^ NOTICE THAT "None" HAS BEEN SUBSTITUTED IN THE LIST OF CONSUMED SUBSCRIPTIONS FOR Service Level AND Service Type.  IN MY OPINION THIS IS WRONG SINCE A VALUE OF "None" COULD BE A VALID VALUE.





Actual results:
see above


Expected results:
Subscription Name:    	Awesome OS with unlimited virtual guests
Provides:             	Awesome OS Server Bits
SKU:                  	awesomeos-virt-unlimited
Contract:             	108
Account:              	12331131231
Serial Number:        	1202756969050095708
Active:               	True
Quantity Used:        	1
Service Level:        	                 <==== IMO, NO VALUE IS THE BEST CHOICE
Service Type:         	                 <==== IMO, NO VALUE IS THE BEST CHOICE
Starts:               	06/20/2012
Ends:                 	08/20/2013

Comment 1 Adrian Likins 2012-08-01 17:58:00 UTC
commit 736fbf8528776411f6df21eea58f2d96a0f449b4
Author: Adrian Likins <alikins>
Date:   Wed Aug 1 13:49:35 2012 -0400

    842170: replace None service level/type with "" not None
    
    Empty or null/None service levels were being listed as
    None in list --consumed. Which is confusing since
    "None" (the string)[1] is a valid service level, so
    it was also wrong.
    
    Issue was "%s" % None or "blip", the % has precedence,
    so the LHS was always a non empty string (because
    we sub in a translated "None" string for None objects)
    and therefore never False.
    
    [1] yeah, I know...


(out for review)

Comment 2 RHEL Program Management 2012-08-02 14:29:37 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 3 Shwetha Kallesh 2012-08-02 15:43:54 UTC
Marking verified!!
Verifying version:
[root@dhcp201-115 ~]# rpm -qa | grep subscription-manager
subscription-manager-migration-data-1.11.2.2-1.git.2.c3c8e22.el5
subscription-manager-1.0.11-1.git.18.251f393.el5
subscription-manager-gui-1.0.11-1.git.18.251f393.el5
subscription-manager-firstboot-1.0.11-1.git.18.251f393.el5
subscription-manager-migration-1.0.11-1.git.18.251f393.el5


[root@dhcp201-115 ~]# subscription-manager register --username=testuser1 --password=password --org=admin --force
The system has been registered with id: d5eff76a-0e8d-46b3-9307-0aaaf2ea2f68 
[root@dhcp201-115 ~]# subscription-manager list --avail | grep awesomeos-virt-unlimited -B1 -A8
Subscription Name:    	Awesome OS with unlimited virtual guests
SKU:                  	awesomeos-virt-unlimited
Pool Id:              	8ac1493438e7fc1b0138e7fcd8eb0291
Quantity:             	10
Service Level:        	
Service Type:         	
Multi-Entitlement:    	No
Ends:                 	08/02/2013
Machine Type:         	physical

Subscription Name:    	Awesome OS with unlimited virtual guests
SKU:                  	awesomeos-virt-unlimited
Pool Id:              	8ac1493438e7fc1b0138e7fcd92e0299
Quantity:             	5
Service Level:        	
Service Type:         	
Multi-Entitlement:    	No
Ends:                 	08/02/2013
Machine Type:         	physical

[root@dhcp201-115 ~]# subscription-manager subscribe --pool 8ac1493438e7fc1b0138e7fcd92e0299
Successfully consumed a subscription for: Awesome OS with unlimited virtual guests
[root@dhcp201-115 ~]# subscription-manager list --consumed
Subscription Name:    	Awesome OS with unlimited virtual guests
Provides:             	Awesome OS Server Bits
SKU:                  	awesomeos-virt-unlimited
Contract:             	108
Account:              	12331131231
Serial Number:        	2719650006605071289
Active:               	True
Quantity Used:        	1
Service Level:        	
Service Type:         	
Starts:               	08/02/2012
Ends:                 	08/02/2013

Comment 5 errata-xmlrpc 2013-01-08 03:57:35 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-2013-0033.html


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