Bug 922825 - pre_subscribe_hook is passed a conduit that should contain more relevant data
Summary: pre_subscribe_hook is passed a conduit that should contain more relevant data
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: beta
: 5.10
Assignee: Michael Stead
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel510 rhsm-2013
TreeView+ depends on / blocked
 
Reported: 2013-03-18 15:40 UTC by John Sefler
Modified: 2013-09-30 23:00 UTC (History)
5 users (show)

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


Attachments (Terms of Use)


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-03-18 15:40:48 UTC
Description of problem:
When a pre_subscribe_hook is defined in a /usr/share/rhsm-plugins/<plugin>.py file, it is passed a conduit.  Currently the conduit contains the following:


['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_conf', 'conf_bool', 'conf_float', 'conf_int', 'conf_string', 'consumer_uuid', 'log', 'slots']

While the consumer_uuid is useful, I do not see any references to the pool that is about to be subscribed to, nor the quantity, nor if this is an auto_heal event.

Bottom line:  I think more relevant data could be passed to the pre_subscribe_hook.


Version-Release number of selected component (if applicable):
[root@rhsm-accept-rhel6 ~]# rpm -q subscription-manager
subscription-manager-1.8.4-1.git.31.00b0b78.el6.x86_64

Comment 1 RHEL Program Management 2013-04-09 20:17:32 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 John Sefler 2013-06-07 19:39:46 UTC
Verifying Version...
[root@jsefler-5 rhsm-plugins]# rpm -q subscription-manager python-rhsm
subscription-manager-1.8.10-1.el5
python-rhsm-1.8.12-1.el5

After adding this line of python to a pre_subscribe_hook in one of the plugins found in /usr/share/rhsm-plugins

 print dir(conduit)

I can now see what is passed...


[root@jsefler-5 rhsm-plugins]# subscription-manager subscribe --pool 8a90f8df3f19d2bc013f19d5409508ad
sending dbus signal with message: post_facts_collection
sending dbus signal with message: pre_subscribe
['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__', '_conf', 'conf_bool', 'conf_float', 'conf_int', 'conf_string', 'consumer_uuid', 'log', 'pool_id', 'quantity', 'slots']
sending dbus signal with message: post_subscribe
Successfully attached a subscription for: Multi-Attribute Stackable (2 GB, 2 Cores)


VERIFIED: The pre_subscribe conduit now includes 'pool_id' and 'quantity' which is definitely additional relevant data

Comment 5 errata-xmlrpc 2013-09-30 23:00:29 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.