Description of problem: When activating a Satellite server with rhn-satellite-activate, and the path to a manifest file is entered with a tilde (~) for a home directory, the path is not expanded and the manifest is not found by activation command. Version-Release number of selected component (if applicable): spacewalk-backend-tools-2.5.3-111.el6sat How reproducible: always Steps to Reproduce: 1. Place the manifest file in your home dir 2. # ls -lh ~/manifest.zip -rw-r--r--. 1 root root 424K Apr 24 09:24 /root/manifest.zip # rhn-satellite-activate --manifest=~/manifest.zip ERROR: unhandled exception occurred: Traceback (most recent call last): File "/usr/bin/rhn-satellite-activate", line 38, in <module> sys.exit(abs(mod.main() or 0)) File "/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/rhn_satellite_activate.py", line 488, in main cdn_activate = cdn_activation.Activation(options.manifest) File "/usr/lib/python2.6/site-packages/spacewalk/cdn_tools/activation.py", line 37, in __init__ self.manifest = Manifest(manifest_path) File "/usr/lib/python2.6/site-packages/spacewalk/cdn_tools/manifest.py", line 60, in __init__ top_zip = zipfile.ZipFile(zip_path, 'r') File "/usr/lib64/python2.6/zipfile.py", line 683, in __init__ self.fp = open(file, modeDict[mode]) IOError: [Errno 2] No such file or directory: '~/manifest.zip' Actual results: Path is not expanded and manifest file is not found. Expected results: Path is expanded and manifest file is successfully opened. Additional info: Same problem when using ~username shortut, for example "~root/manifest.zip"
I think this is expected. Jan, can you confirm rhn-satellite-activate works with absolute paths only?
No, rhn-satellite-activate takes also relative paths, the problem here is tilde expansion is not done. It's a minor bug, however, the fix is easy and it was already solved in our other python tools. I would definitely fix it.
The bug is fixed in upstream: deb291d682b4b66f3e2297c6e0108e439dce4f02
spacewalk.git: 67875c07dfe9a4afe5ba126ca58a79257285532c
verified spacewalk-backend-tools-2.5.3-130.el6sat.noarch