Bug 672562

Summary: request for subscription-manager list --available --ondate option
Product: Red Hat Enterprise Linux 6 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Chris Duryee <cduryee>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.1CC: cduryee, jesusr, jmolet
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: 2011-05-19 13:39:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 568421    

Description John Sefler 2011-01-25 15:44:03 UTC
Description of problem:
For the sake of parity between the subscription-manager-gui and subscription-manager command line tool, the command line tool is missing the ability to list available subscriptions that are valid on a particular date.  The gui tool currently has this functionality.

Currently, subscription-manager list --available --all excludes subscriptions that are not valid on the current date.  There is no way to see what subscriptions are available to me in the future using the command line tool.

[root@jsefler-onprem01 ~]# subscription-manager list --help
Usage: subscription-manager list [OPTIONS]

list available or consumed Entitlement Pools for this system.

Options:
  -h, --help            show this help message and exit
  --debug=DEBUG         debug level
  --proxy=PROXY_URL     proxy url in the form of proxy_hostname:proxy_port
  --proxyuser=PROXY_USER
                        user for http proxy with basic authentication
  --proxypassword=PROXY_PASSWORD
                        password for http proxy with basic authentication
  --installed           installed
  --available           available
  --consumed            consumed
  --all                 if supplied with --available then all subscriptions
                        are returned


Version-Release number of selected component (if applicable):
[root@jsefler-onprem01 ~]# rpm -qa | grep subscription-manager
subscription-manager-firstboot-0.93.14-1.git.9.304e707.el6.x86_64
subscription-manager-0.93.14-1.git.9.304e707.el6.x86_64
subscription-manager-gnome-0.93.14-1.git.9.304e707.el6.x86_64

Comment 2 Chris Duryee 2011-02-11 15:19:54 UTC
fixed in rhel6 branch, ffe17cd 0.95.2+
fixed in master branch, 1b076 0.96.2+

Comment 5 J.C. Molet 2011-02-18 14:29:34 UTC
Testing on:
subscription-manager-0.95.1-1.git.15.c75e560.el6.x86_64
subscription-manager-gnome-0.95.1-1.git.15.c75e560.el6.x86_64
subscription-manager-firstboot-0.95.1-1.git.15.c75e560.el6.x86_64
python-rhsm-0.95.3-1.git.0.4d0ef8e.el6.noarch

I don't think this is working.  I ran a `subscription-manager list --available` to get a list of subscriptions.  On my test candlepin server all the subscriptions shown ended on 2012-02-17.   I then ran `subscription-manager list --available --ondate=2012-02-18`.  This showed an additional set of subscriptions ending on a later date, but it also showed subscriptions that should have ended by that date.  An excerpt:

                        
[root@jmolet-vm0 rhsm]# subscription-manager list --available --ondate=2012-02-18
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+


ProductName:       	Awesome OS Modifier      
ProductId:         	awesomeos-modifier       
PoolId:            	8a90f88e2e3802ab012e380345de0203
Quantity:          	5                        
Expires:           	2012-02-17               


ProductName:       	Awesome OS Modifier      
ProductId:         	awesomeos-modifier       
PoolId:            	8a90f88e2e3802ab012e380345c70200
Quantity:          	10                       
Expires:           	2012-02-17               


ProductName:       	Awesome OS Modifier      
ProductId:         	awesomeos-modifier       
PoolId:            	8a90f88e2e3802ab012e380345af01fd
Quantity:          	15                       
Expires:           	2013-02-06     

This leads me to believe that the search isn't removing ones past that date properly.

Additionally there is no mention of --ondate in the man pages.

Comment 6 Chris Duryee 2011-03-03 21:15:15 UTC
This is fixed in 0.95.4

Comment 8 J.C. Molet 2011-03-09 21:42:10 UTC
This is tested as working.  Moving to VERIFIED


[root@jmolet-vm0 rhn]# subscription-manager list --available | grep "Awesome OS Modifier" -A 5
ProductName:       	Awesome OS Modifier      
ProductId:         	awesomeos-modifier       
PoolId:            	8a90f88e2e9b7a06012e9b7aa1610216
Quantity:          	10                       
Expires:           	2012-03-07               

--
ProductName:       	Awesome OS Modifier      
ProductId:         	awesomeos-modifier       
PoolId:            	8a90f88e2e9b7a06012e9b7aa1750219
Quantity:          	5                        
Expires:           	2012-03-07               

[root@jmolet-vm0 rhn]# subscription-manager list --available --ondate=2012-03-08 | grep "Awesome OS Modifier" -A 5
ProductName:       	Awesome OS Modifier      
ProductId:         	awesomeos-modifier       
PoolId:            	8a90f88e2e9b7a06012e9b7aa14d0213
Quantity:          	15                       
Expires:           	2013-02-25               

[root@jmolet-vm0 rhn]# subscription-manager list --available --ondate=2013-02-26 | grep "Awesome OS Modifier" -A 5
[root@jmolet-vm0 rhn]# rhsm-version 
subscription-manager-0.95.4-1.git.1.bb03d4e.el6.x86_64
subscription-manager-firstboot-0.95.4-1.git.1.bb03d4e.el6.x86_64
subscription-manager-gnome-0.95.4-1.git.1.bb03d4e.el6.x86_64
python-rhsm-0.95.4-1.git.0.1189f1a.el6.noarch

Comment 9 errata-xmlrpc 2011-05-19 13:39:13 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-0611.html