Bug 1051580 - Activation Keys with Spaces in their names fail in the default kickstart file
Summary: Activation Keys with Spaces in their names fail in the default kickstart file
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Provisioning
Version: 6.0.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Tom McKay
QA Contact: Kedar Bidarkar
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-10 15:56 UTC by Bryan Kearney
Modified: 2019-09-26 14:07 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-02 14:07:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 5857 0 None None None 2016-04-22 15:50:28 UTC

Description Bryan Kearney 2014-01-10 15:56:24 UTC
If the kickstart file is generated with Spaces, then the following is generated in the kickstart file:

Assume Activtion Key Name is "A Test Key"

subscription-manager regiseter --activationkey A Test Key

This fails, since Test and Key are parsed as options. It needs to have quotes to make it work.

Comment 2 Dominic Cleal 2014-01-20 14:37:04 UTC
Although this bug is actually in foreman-katello-engine:
https://github.com/Katello/foreman-katello-engine/blob/62826633/app/views/unattended/snippets/_subscription_manager_registration.erb#L7

I'm linking it to the issue on our current sprint to pull this snippet into Foreman's community templates and core, then we'll fix it in the process.

Comment 4 Dominic Cleal 2014-03-10 10:29:18 UTC
Fixed in Foreman's snippets, but it appears Katello still ships their own.

Comment 5 Bryan Kearney 2014-03-24 13:35:43 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/3842 has been closed

Comment 7 Tazim Kolhar 2014-05-09 11:37:03 UTC
# subscription-manager register  --activationkey=A test key
cannot parse argument: test
cannot parse argument: key

Comment 8 Tom McKay 2014-05-12 13:55:55 UTC
@tazim - Note that the test scenario described is incorrect. The nature of the issue is that the kickstart file is not escaping or quoting activation key names when it references them. Your example (sub-mgr register --activationkey=A test key) will never work, nor should you expect it to. You would need to quote the name yourself as either "A test key" or A\ test\ key

That said, this BZ still exists as far as I know in the kickstart file.

Thanks!

Comment 9 Tazim Kolhar 2014-05-12 14:37:09 UTC
# subscription-manager register --force --activationkey 'A test key' --org ACME_Corporation
Network error, unable to connect to server.
Please see /var/log/rhsm/rhsm.log for more information.

Comment 10 Kedar Bidarkar 2014-05-13 10:58:53 UTC
Network error, unable to connect to server looks like to be NTP issue. the date/time could be different.

the below command could get executed successfully for me. But this needs to be checked with a kickstart file. We need to look into it further about the exact scenario.

 ~]# subscription-manager register --org ACME_Corporation --activationkey "A test key2"
The system has been registered with ID: 12f9052d-c6f7-4fc7-b710-2c4ab280c3a0 


sorry the idea for now is to put the bug on right track.

Comment 11 Tom McKay 2014-05-21 17:00:26 UTC
Created redmine issue http://projects.theforeman.org/issues/5857 from this bug

Comment 12 Kedar Bidarkar 2014-05-28 15:52:46 UTC
I now know the exact scenario to test this bug, will assign it to self.

Comment 14 Kedar Bidarkar 2014-05-29 07:06:06 UTC
The activation key with spaces was used to register the provisioned rhel6box to sat6box.

[root@netgear ~]# yum repolist
Loaded plugins: product-id, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
ACME_Corporation_RHEL6_RHEL65_x86_64                                                                                                                                   | 2.9 kB     00:00     
repo id                                                                                                repo name                                                                        status
ACME_Corporation_RHEL6_RHEL65_x86_64                                                                   RHEL65_x86_64                                                                    3,690
repolist: 3,690

The below ananconda-ks.cfg file was used to provision a vm and as visible an activation key with spaces was used.

[root@netgear ~]# cat anaconda-ks.cfg | grep -i "ak with space_ks"
subscription-manager register --org="ACME_Corporation" --name="netgear.katellolabs.org" --activationkey="ak with space_ks"

Comment 15 Kedar Bidarkar 2014-05-29 07:26:00 UTC
The build used to verify this bug is sat6-beta-snap7

Comment 16 Bryan Kearney 2014-07-02 14:07:03 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.


Note You need to log in before you can comment on or make changes to this bug.