Hide Forgot
Description of problem: bootstrap.py script cannot handle a whitespace in the activation key name when making a call to /usr/sbin/rhn-migrate-classic-to-rhsm Version-Release number of selected component (if applicable): Satellite 6.2.3 How reproducible: Always. Steps to Reproduce: 1. Create an activation key with whitespace in the name (e.g.): RHEL 6 2. Use the bootstrap.py from katello-client-bootstrap RPM 3. Example usage on a client currently registered to RHN (so boo: # /root/bootstrap.py --force -l admin -s satellite6.example.com -o 'myorg' -L 'mylocation' -g RHEL6_hostgroup -a "RHEL 6" Actual results: Output will have an error complaining that it couldn't find activation key "RHEL" instead of using "RHEL 6", when it makes a call to /usr/sbin/rhn-migrate-classic-to-rhsm [ERROR], [2016-11-08 14:01:56], EXITING: [/usr/sbin/rhn-migrate-classic-to-rhsm --org myorg --activation-key RHEL 6 --destination-url=https://satellite6.example.com:443/rhsm --keep --force] failed to execute properly. Couldn't find activation key 'RHEL' Expected results: The full argument of the activation key is passed to /usr/sbin/rhn-migrate-classic-to-rhsm and interpreted as a single entity. Additional info: In the bootstrap.py:migrate_systems() function, line 202 below should have (at least) the second %s wrapped in single-quotes as is done in the register_systems() call right below it. If I make that modification, it appears to pass the activation key correctly. I suspect the %s for the org should also be surrounded by single-quotes. 192 def migrate_systems(org_name, activationkey): 193 org_label = return_matching_katello_key('organizations', 'name="%s"' % org_name, 'label', False) 194 print_generic("Calling rhn-migrate-classic-to-rhsm") 195 options.rhsmargs += " --destination-url=https://%s:%s/rhsm" % (options.foreman_fqdn, API_PORT) 196 if options.legacy_purge: 197 options.rhsmargs += " --legacy-user '%s' --legacy-password '%s'" % (options.legacy_login, options.legacy_password) 198 else: 199 options.rhsmargs += " --keep" 200 if options.force: 201 options.rhsmargs += " --force" 202 exec_failexit("/usr/sbin/rhn-migrate-classic-to-rhsm --org %s --activation-key %s %s" % (org_label, activationkey, options.rhsmargs)) 203 exec_failexit("subscription-manager config --rhsm.baseurl=https://%s/pulp/repos" % options.foreman_fqdn)
Fixed upstream in this commit (https://github.com/Katello/katello-client-bootstrap/commit/7a1215fe19df0392dd83e3a7063f59ca4eb55667).
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. https://access.redhat.com/errata/RHSA-2018:0336