Bug 773707

Summary: install-num-migrate-to-rhsm should NOT be hard coded to /etc/pki/product/
Product: Red Hat Enterprise Linux 5 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Chris Duryee <cduryee>
Status: CLOSED CURRENTRELEASE QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.8CC: awood, cduryee, khong, skallesh, spandey
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: 2012-12-10 21:41:51 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: 738066    

Description John Sefler 2012-01-12 17:01:05 UTC
Description of problem:
install-num-migrate-to-rhsm is copying product certs to a hard coded "/etc/pki/product/".  It should read rhsm.productCertDir from the /etc/rhsm/rhsm.conf file.

See implementation in rhn-migrate-classic-to-rhsm tool.  It appears more robust.


[root@hp-dl585-02 ~]# grep "/etc/pki/product/" `which install-num-migrate-to-rhsm`
PRODUCT_CERT_DIR = '/etc/pki/product/'
[root@hp-dl585-02 ~]# 

^^^ YUP - IT'S HARDCODED


Version-Release number of selected component (if applicable):
[root@hp-dl585-02 ~]# rpm -q subscription-manager-migration
subscription-manager-migration-0.98.11-1.el5


How reproducible:


Steps to Reproduce:
[root@hp-dl585-02 ~]# subscription-manager config --rhsm.productcertdir=/tmp/products

[root@hp-dl585-02 ~]# install-num-migrate-to-rhsm
Copying /usr/share/rhsm/product/RHEL-5/Server-Server-i386-8283bfc7-e1a1-46b0-8f3a-00ae03ee4822-69.pem to /etc/pki/product/69.pem
Copying /usr/share/rhsm/product/RHEL-5/Server-ClusterStorage-i386-a3429260-14b7-4256-8bc2-9a099bc303f8-90.pem to /etc/pki/product/90.pem
Copying /usr/share/rhsm/product/RHEL-5/Server-Cluster-i386-b79bfdf1-a36b-4483-abe8-da53e9903196-83.pem to /etc/pki/product/83.pem

[root@hp-dl585-02 ~]# subscription-manager list --installed
No installed Products to list

^^^ EXPECTED THE PRODUCT CERTS TO COPY TO /tmp/products AND THEN THEY WOULD BE REPORTED BY list --installed.
  

Additional info:

Comment 1 RHEL Program Management 2012-01-18 05:12:00 UTC
Since RHEL 5.8 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 2 Chris Duryee 2012-01-30 18:48:38 UTC
ca657e9 master 0.99.6+

Comment 3 Shwetha Kallesh 2012-02-10 09:13:06 UTC
Moving bug to verified.

RPM used:

[root@dhcp201-132 product1]# rpm -qa | grep subscription-manager
subscription-manager-gnome-0.99.6-1.git.14.bf30609.el5
subscription-manager-migration-0.99.6-1.git.14.bf30609.el5
subscription-manager-debuginfo-0.98.15-1.el5_8
subscription-manager-0.99.6-1.git.14.bf30609.el5
subscription-manager-migration-data-1.11-1.el5
subscription-manager-firstboot-0.99.6-1.git.14.bf30609.el5



[root@dhcp201-132 product1]# subscription-manager config --rhsm.productcertdir=/tmp/product1


[root@dhcp201-132 pki]# install-num-migrate-to-rhsm
Copying /usr/share/rhsm/product/RHEL-5/Server-Server-x86_64-a515006cc2b2-69.pem to /etc/pki/product1/69.pem
Copying /usr/share/rhsm/product/RHEL-5/Server-ClusterStorage-x86_64-6f77ee75b530-90.pem to /etc/pki/product1/90.pem
Copying /usr/share/rhsm/product/RHEL-5/Server-Cluster-x86_64-66b437153a23-83.pem to /etc/pki/product1/83.pem


[root@dhcp201-132 product1]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
ProductName:          	Red Hat Enterprise Linux High Availability (for RHEL Server)
Version:              	5.8                      
Arch:                 	x86_64                   
Status:               	Not Subscribed           
Starts:               	None                     
Expires:              	None                     

ProductName:          	Red Hat Enterprise Linux Server
Version:              	5.8                      
Arch:                 	x86_64                   
Status:               	Not Subscribed           
Starts:               	None                     
Expires:              	None                     

ProductName:          	Red Hat Enterprise Linux Resilient Storage (for RHEL Server)
Version:              	5.8                      
Arch:                 	x86_64                   
Status:               	Not Subscribed           
Starts:               	None                     
Expires:              	None

Comment 4 Alex Wood 2012-02-10 14:21:05 UTC
> [root@dhcp201-132 product1]# subscription-manager config
> --rhsm.productcertdir=/tmp/product1
> 
> [root@dhcp201-132 pki]# install-num-migrate-to-rhsm
> Copying /usr/share/rhsm/product/RHEL-5/Server-Server-x86_64-a515006cc2b2-69.pem
> to /etc/pki/product1/69.pem
> Copying
> /usr/share/rhsm/product/RHEL-5/Server-ClusterStorage-x86_64-6f77ee75b530-90.pem
> to /etc/pki/product1/90.pem
> Copying
> /usr/share/rhsm/product/RHEL-5/Server-Cluster-x86_64-66b437153a23-83.pem to
> /etc/pki/product1/83.pem

The output from the script is printing out the wrong directory though.  I think that should be fixed as well.

Comment 5 Bryan Kearney 2012-12-10 21:41:51 UTC
Bug Clean Up, these are in the current release.