Description of problem: Version-Release number of selected component (if applicable): How reproducible: 3/3 Prerequisites: rhel5.9 with following subscription-manager rpm subscription-manager-migration-1.0.9-1.git.22.35b5155.el5 subscription-manager-1.0.9-1.git.22.35b5155.el5 subscription-manager-gui-1.0.9-1.git.22.35b5155.el5 subscription-manager-firstboot-1.0.9-1.git.22.35b5155.el5 subscription-manager-migration-data-1.11.2.2-1.git.0.2eea155.el5 Steps to Repro: Edit rhsm.conf for product location . Specify location which doesnot exists. “productCertDir = /etc/pki/product1” Start install num migration with valid installation number . “install-num-migrate-to-rhsm -i 20f91e3421ed551e” Expected Result : Actual Result : [root@dhcp193-39 pki]# install-num-migrate-to-rhsm -i 20f91e3421ed551e Copying /usr/share/rhsm/product/RHEL-5/Server-Server-x86_64-dfb340743a6e-69.pem to /etc/pki/product1/69.pem Traceback (most recent call last): File "/usr/sbin/install-num-migrate-to-rhsm", line 150, in ? main() File "/usr/sbin/install-num-migrate-to-rhsm", line 144, in main shutil.copyfile(path, dest_file) File "/usr/lib64/python2.4/shutil.py", line 48, in copyfile fdst = open(dst, 'wb') IOError: [Errno 2] No such file or directory: '/etc/pki/product1/69.pem'
commit b5e32ecb0e5b4e49bff47ec565ebf0e9fb722102 Author: Alex Wood <awood> Date: Tue Sep 11 11:41:30 2012 -0400 840415: Handle copyfile errors gracefully. Available in subscription-manager-1.0.18+
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.
re-testing version... [root@jsefler-rhel59 ~]# rpm -q subscription-manager-migration subscription-manager-migration-1.0.18-1.el5 [root@jsefler-rhel59 ~]# rm -rf /etc/pki/product1 [root@jsefler-rhel59 ~]# sed -i 's/^productCertDir\s*=.*$/productCertDir=\/etc\/pki\/product1/g' /etc/rhsm/rhsm.conf [root@jsefler-rhel59 ~]# install-num-migrate-to-rhsm -i 20f91e3421ed551e Installing /usr/share/rhsm/product/RHEL-5/Server-Server-x86_64-dfb340743a6e-69.pem to /etc/pki/product1/69.pem [Errno 2] No such file or directory: '/etc/pki/product1/69.pem' ^^^ VERIFIED: The traceback has been eliminated and the migration attempt errors out due to the missing /etc/pki/product1 directory. This is fine, however... [root@jsefler-rhel59 ~]# install-num-migrate-to-rhsm -i 20f91e3421ed551e --dryrun Installing /usr/share/rhsm/product/RHEL-5/Server-Server-x86_64-dfb340743a6e-69.pem to /etc/pki/product1/69.pem ^^^ BANG! The --dryrun option should also catch the missing productcertdir and error out too. Afterall, the purpose of the dryrun is to catch problems like this. Moving back to ASSIGNED
I would move this out to 6.4, doesn't seem like it should be a blocker.
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate, in the next release of Red Hat Enterprise Linux.
Moving back to 5.9 since the install-num-migrate-to-rhsm is a RHEL5 only tool. Hopefully it is an easy fix. Otherwise it would be deferred to 5.10
Unfortunately, fixing this is going to require a new string. Currently in the script when it attempts to copy the file over and fails, that error message comes from Python's shutil, and the message is already internationalized. Catching the error case during a dry run would require testing for the directory's existence ourselves and writing out a custom error message if the directory didn't exist. Deferring until 5.10 since we are past string freeze and there are no appropriate strings already translated.
commit 1721610e8a524be39fdabd9204243a7cba7f1cee Author: Alex Wood <awood> AuthorDate: Wed Oct 17 11:07:41 2012 -0400 Commit: Alex Wood <awood> CommitDate: Wed Oct 17 11:09:08 2012 -0400 840415: Print an error message if the destination directory does not exist. Available in subscription-manager-1.1.4-1
Sounds like this is fixed to me. Moving to modified.
Moving back to RHEL5 since the install-num-migrate-to-rhsm is a RHEL5 only tool.
Version: # subscription-manager version server type: Red Hat Subscription Management subscription management server: 0.9.12-1 subscription-manager: 1.11.3-3.el5 python-rhsm: 1.11.3-3.el5 VErsification: Steps followed as described in comment4 # rpm -q subscription-manager-migration subscription-manager-migration-1.11.3-3.el5 # rm -rf /etc/pki/product1 # sed -i 's/^productCertDir\s*=.*$/productCertDir=\/etc\/pki\/product1/g' /etc/rhsm/rhsm.conf # cat /etc/rhsm/rhsm.conf | grep productCertDir productCertDir=/etc/pki/product1 # install-num-migrate-to-rhsm -i 20f91e3421ed551e Installing /usr/share/rhsm/product/RHEL-5/Server-Server-x86_64-06e8bd9df3f0-69.pem to /etc/pki/product1/69.pem No such directory: /etc/pki/product1 <<<<<<<<<<<<<<<<<<<< # install-num-migrate-to-rhsm -i 20f91e3421ed551e --dryrun Installing /usr/share/rhsm/product/RHEL-5/Server-Server-x86_64-06e8bd9df3f0-69.pem to /etc/pki/product1/69.pem No such directory: /etc/pki/product1 <<<<<<<<<<<<<<<< VERIFIED
This bugzilla has been obsoleted by the decsion to remove install-num-migrate-to-rhsm from the subscription-manager-migration package in https://bugzilla.redhat.com/show_bug.cgi?id=1092754#c5
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-2014-1225.html