Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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)
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
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)