Bug 983250 - subscription-manager-gui uses a hard-coded WARNING_DAYS = 6 * 7; warning_period from entitlement is ignored
Summary: subscription-manager-gui uses a hard-coded WARNING_DAYS = 6 * 7; warning_per...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager
Version: 5.10
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Carter Kozak
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel510
TreeView+ depends on / blocked
 
Reported: 2013-07-10 19:56 UTC by John Sefler
Modified: 2014-09-15 00:08 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
No description necessary
Clone Of:
Environment:
Last Closed: 2013-09-30 23:12:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
warning icon (201.69 KB, image/png)
2013-08-07 14:49 UTC, Sharath Dwaral
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1332 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2013-09-30 22:49:24 UTC

Description John Sefler 2013-07-10 19:56:09 UTC
Description of problem:
One of the attributes of a subscription product is warning_period.  The intent of this attribute is to warn the consumer that the entitlement is about to expire within this number of days before the end date.  Within the subscription-manager-gui, the subscription about to expire will turn yellow on the "My Subscriptions" tab.  Unfortunately the subscription-manager-gui appears to be using a hard-coded warning period of 42 days instaed of using the value from the entitlement.

The hard-coded values are found here...

[root@jsefler-5 ~]# grep WARNING_DAYS /usr/share/rhsm/subscription_manager/gui/*.py
/usr/share/rhsm/subscription_manager/gui/mysubstab.py:WARNING_DAYS = 6 * 7   # 6 weeks * 7 days / week
/usr/share/rhsm/subscription_manager/gui/mysubstab.py:        if date_range.end() - timedelta(days=WARNING_DAYS) < now:
/usr/share/rhsm/subscription_manager/gui/widgets.py:WARNING_DAYS = 6 * 7   # 6 weeks * 7 days / week
/usr/share/rhsm/subscription_manager/gui/widgets.py:        if end - datetime.timedelta(days=WARNING_DAYS) < now:

To see what the warning period should be for each consumed subscription, use the rct cat-cert tool like this...

[root@jsefler-5 ~]# for f in `ls /etc/pki/entitlement/*.pem | grep -v key`; do rct cat-cert --no-content $f | egrep "Name|Warning Period"; done;
	Name: Awesome OS Server Basic (data center)
	Warning Period: 30
	Name: Awesome OS Server Bits
	Name: Awesome OS Server Basic (dc-virt)
	Warning Period: 0


Version-Release number of selected component (if applicable):
[root@jsefler-5 ~]# rpm -q subscription-manager-gui
subscription-manager-gui-1.8.11-1.el5


Additional info:

Comment 1 RHEL Program Management 2013-07-10 20:17: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 2 Carter Kozak 2013-07-12 20:18:12 UTC
commit eacaa452361e1f716390ad3fd90cf65e9c3f3c76
Author: ckozak <ckozak>
Date:   Wed Jul 10 11:24:26 2013 -0400

    983250: 983281: certs check warning period

Comment 5 Sharath Dwaral 2013-08-07 14:49:20 UTC
Created attachment 783957 [details]
warning icon

Version:

# rpm -qa | egrep "subscription-manager|python-rhsm"
subscription-manager-gui-1.8.18-1.el5
subscription-manager-migration-data-1.11.3.2-1.git.0.14f9d59.el5
python-rhsm-1.8.16-1.el5
subscription-manager-migration-1.8.18-1.el5
subscription-manager-1.8.18-1.el5
subscription-manager-firstboot-1.8.18-1.el5
python-rhsm-debuginfo-1.8.16-1.el5
subscription-manager-debuginfo-1.8.18-1.el5

Verification:

# grep WARNING_DAYS /usr/share/rhsm/subscription_manager/gui/*.py
/usr/share/rhsm/subscription_manager/gui/widgets.py:WARNING_DAYS = 6 * 7   # 6 weeks * 7 days / week

There is still a hard coded value for WARNING_DAYS but it is not referenced anywhere. 

# for f in `ls /etc/pki/entitlement/*.pem | grep -v key`; do rct cat-cert --no-content $f | egrep "Name|Warning Period"; done;
        Name: Awesome OS Server Bits
	Name: Awesome OS Server Basic (multi-entitlement)
	Warning Period: 30

# rct cat-cert /etc/pki/entitlement/8294565152797454133.pem | grep -i "certificate:" -A7
Certificate:
	Path: /etc/pki/entitlement/8294565152797454133.pem
	Version: 3.2
	Serial: 8294565152797454133
	Start Date: 2013-07-30 00:00:00+00:00
	End Date: 2014-07-30 00:00:00+00:00
	Pool ID: 8a8d01e0402f9e3b01402f9f6040049a

Advancing date to within warning period

# date -s "30 JUN 2014 18:00:00"

Warning icon is displayed in "My Subscription" tab (See attachment)

Comment 6 Sharath Dwaral 2013-08-07 14:49:51 UTC
Moving to VERIFIED

Comment 8 errata-xmlrpc 2013-09-30 23:12:57 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-1332.html


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