Bug 922871 - pre_product_id_install_hook is not being called
Summary: pre_product_id_install_hook is not being called
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 17:24 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:42 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 17:24:36 UTC
Description of problem:
When a pre_product_is_install_hook is defined in a /usr/share/rhsm-plugins/<plugin>.py file (such as https://github.com/candlepin/subscription-manager/blob/master/example-plugins/product_install.py), it is currently not being called.  There is no trace of a call to the pre_product_is_install_hook in the rhsm.log.  However there IS a trace of a call to post_product_is_install_hook.

Actual:
> 2013-03-18 13:09:59,144 [DEBUG]  @plugins.py:695 - Running post_product_id_install_hook in product_id_install_test.ProductIdInstallTestPlugin

Expected:
A similar rhsm.log trace for pre_product_id_install_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:26 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-07-05 15:43:21 UTC
Verifying Version...
[root@jsefler-5 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: Unknown
subscription-manager: 1.8.11-1.el5
python-rhsm: 1.8.12-1.el5


To verify this bug, the following test plugin was written, installed, and enabled: https://github.com/RedHatQE/rhsm-qe/blob/master/test-plugins/product_id_install_test.py

[root@jsefler-5 ~]# subscription-manager plugins --list | grep enabled
product_id_install_test.ProductIdInstallTestPlugin: enabled

Then we registered a RHEL system to the stage environment, subscribed to High Availability and installed a package from the repo expecting the product id plugin to install 83.pem.  Here we go...

[root@jsefler-5 ~]# subscription-manager register --user=stage_test_2 --serverurl=subscription.rhn.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: d1cf9fe5-f82d-405c-83dd-7f8745a78a4e 

[root@jsefler-5 ~]# subscription-manager list --avail | grep RH1149049 -B1 -A1 | tail -3
Subscription Name: High-Availability (8 sockets)
SKU:               RH1149049
Pool ID:           8a99f9843c01ccba013c037a0fd40169

[root@jsefler-5 ~]# subscription-manager subscribe --pool 8a99f9843c01ccba013c037a0fd40169
Successfully attached a subscription for: High-Availability (8 sockets)

[root@jsefler-5 ~]# subscription-manager list --installed | grep ID -B1 | grep 83 -B1
[root@jsefler-5 ~]# 

[root@jsefler-5 ~]# yum repolist
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
This system is not registered with RHN Classic or RHN Satellite.
You can use rhn_register to register.
RHN Satellite or RHN Classic support will be disabled.
rhel-ha-for-rhel-5-server-rpms                                | 3.7 kB     00:00     
repo id                        repo name                                       status
rhel-ha-for-rhel-5-server-rpms Red Hat Enterprise Linux High Availability (for 204
repolist: 204

[root@jsefler-5 ~]# yum -y install Cluster_Administration-bn-IN
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
This system is not registered with RHN Classic or RHN Satellite.
You can use rhn_register to register.
RHN Satellite or RHN Classic support will be disabled.
rhel-ha-for-rhel-5-server-rpms                                | 3.7 kB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package Cluster_Administration-bn-IN.noarch 0:5.8-1.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================
 Package                      Arch   Version    Repository                      Size
=====================================================================================
Installing:
 Cluster_Administration-bn-IN noarch 5.8-1.el5  rhel-ha-for-rhel-5-server-rpms 2.4 M

Transaction Summary
=====================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 2.4 M
Downloading Packages:
Cluster_Administration-bn-IN-5.8-1.el5.noarch.rpm             | 2.4 MB     00:01     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : Cluster_Administration-bn-IN                                  1/1 

Installed:
  Cluster_Administration-bn-IN.noarch 0:5.8-1.el5                                    

Complete!

[root@jsefler-5 ~]# subscription-manager list --installed | grep ID -B1 | grep 83 -B1
Product Name:   Red Hat Enterprise Linux High Availability (for RHEL Server)
Product ID:     83

VERIFIED: product id 83 for High Availability was installed
Now let's look at the rhsm.log to verify that our pre_product_id_install_hook and post_product_id_install_hook were called....


[root@jsefler-5 ~]# tail -f /var/log/rhsm/rhsm.log
2013-07-05 11:03:02,911 [DEBUG]  @plugins.py:522 - loaded plugins: {'product_id_install_test.ProductIdInstallTestPlugin': <product_id_install_test.ProductIdInstallTestPlugin object at 0xdb9bcd0>}
2013-07-05 11:03:02,939 [DEBUG]  @productid.py:212 - Updating installed certificates
2013-07-05 11:03:02,940 [DEBUG]  @productid.py:222 - product cert: 83 repo: rhel-ha-for-rhel-5-server-rpms
2013-07-05 11:03:02,974 [DEBUG]  @plugins.py:700 - PluginManager.run called for pre_product_id_install with args: {'product_list': [(<rhsm.certificate2.Product object at 0xdb9c850>, <rhsm.certificate2.ProductCertificate object at 0xdb9cb50>)]}
2013-07-05 11:03:02,975 [DEBUG]  @plugins.py:708 - Running pre_product_id_install_hook in product_id_install_test.ProductIdInstallTestPlugin
2013-07-05 11:03:02,976 [INFO]  @product_id_install_test.py:32 - Running pre_product_id_install_hook: yum product-id plugin is about to install a product cert
2013-07-05 11:03:02,978 [INFO]  @productid.py:282 - Installed product cert 83: Red Hat Enterprise Linux High Availability (for RHEL Server) /etc/pki/product/83.pem
2013-07-05 11:03:02,979 [INFO]  @productid.py:288 - Updating product db with 83 -> rhel-ha-for-rhel-5-server-rpms
2013-07-05 11:03:02,980 [DEBUG]  @productid.py:297 - about to run post_product_id_install
2013-07-05 11:03:02,980 [DEBUG]  @plugins.py:700 - PluginManager.run called for post_product_id_install with args: {'product_list': [<rhsm.certificate2.ProductCertificate object at 0xdb9cb50>]}
2013-07-05 11:03:02,980 [DEBUG]  @plugins.py:708 - Running post_product_id_install_hook in product_id_install_test.ProductIdInstallTestPlugin
2013-07-05 11:03:02,980 [INFO]  @product_id_install_test.py:43 - Running post_product_id_install_hook: yum product-id plugin just installed a product cert
2013-07-05 11:03:02,980 [INFO]  @product_id_install_test.py:44 - Running post_product_id_install_hook: 1 product_ids were just installed
2013-07-05 11:03:02,980 [INFO]  @product_id_install_test.py:55 - Running post_product_id_install_hook: product_id 83 was just installed


VERIFIED:
Running pre_product_id_install_hook in product_id_install_test.ProductIdInstallTestPlugin
Running post_product_id_install_hook in product_id_install_test.ProductIdInstallTestPlugin

Moving bug to VERIFIED.

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