Bug 1140393 - Cant specify comma spaced lists as values to the --parameters option.
Summary: Cant specify comma spaced lists as values to the --parameters option.
Keywords:
Status: CLOSED EOL
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: rubygem-hammer_cli_foreman
Version: Foreman (RHEL 6)
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
: Installer
Assignee: Martin Bacovsky
QA Contact: Omri Hochman
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On: 1141671
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-10 20:36 UTC by joherr
Modified: 2016-09-29 13:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1141671 (view as bug list)
Environment:
Last Closed: 2016-09-29 13:43:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description joherr 2014-09-10 20:36:09 UTC
Description of problem:

A comma seperated list cannot be passed as a value in a key/value pair when using the --parameters option when creating a host.


Version-Release number of selected component (if applicable):
# hammer --version
hammer (0.1.0)
 * hammer_cli_foreman (0.1.0)


How reproducible:
Always

Steps to Reproduce:
1.Create a host and specify the --parameters option with a comma seperated list as a value in a keypair.

2. hammer host create --name "test.example.org" --build true --enabled true --managed true --environment-id 1 --ip "192.168.10.10" --mac "02:00:00:00:00:b0" --subnet-id 1 --architecture-id 1 --medium-id 8 --partition-table-id 11 --root-password changeme --parameters subscription_manager=true,subscription_manager_username=smuser,subscription_manager_password=smpass,subscription_manager_repos="rhel-server-rhscl-6-rpms, rhel-6-server-rpms, rhel-6-server-openstack-5.0-rpms",subscription_manager_pool=34gf434gf34f34f4442

3.

Actual results:
Could not create the host:
  Error: option '--parameters': value must be defined as a comma-separated list of key=value
  
  See: 'hammer host create --help'


Expected results:
Expect the host to be created with appropriate parameters


Additional info:

I am using the --parameters option to the "hammer host create" or "hammer
host update" commands. This option takes a comma seperated list of
key=value pairs. The issue I am running into is I need to specify a comma seperated list as a value.

The above command fails telling me I must specify a comma seperated list
of key/values:

I can specify the same command without the subscription_manager_repos="..." key/value pair and it works fine. If I specify only the subscription_manager_repos="..." key and value, it fails.

I suspect the hammer code is splitting the command at all commas and ignoring any quotes that indicate grouping.

Comment 4 Martin Bacovsky 2014-09-15 12:50:43 UTC
Fix for this issue is included in rubygem-hammer-cli-0.1.3. The PR is
https://github.com/theforeman/hammer-cli/pull/137.

With the patch applied the format of the correct command would be (the list needs to be enclosed in the square brackets, no spaces):

hammer host create --name "test.example.org" --build true --enabled true --managed true --environment-id 1 --ip "192.168.10.10" --mac "02:00:00:00:00:b0" --subnet-id 1 --architecture-id 1 --medium-id 8 --partition-table-id 11 --root-password changeme --parameters "subscription_manager=true,subscription_manager_username=smuser,subscription_manager_password=smpass,subscription_manager_repos=[rhel-server-rhscl-6-rpms,rhel-6-server-rpms,rhel-6-server-openstack-5.0-rpms],subscription_manager_pool=34gf434gf34f34f4442"

Comment 6 Mike McCune 2016-03-28 23:02:11 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 7 Jaromir Coufal 2016-09-29 13:43:38 UTC
Closing list of bugs for RHEL OSP Installer since its support cycle has already ended [0]. If there is some bug closed by mistake, feel free to re-open.

For new deployments, please, use RHOSP director (starting with version 7).

-- Jaromir Coufal
-- Sr. Product Manager
-- Red Hat OpenStack Platform

[0] https://access.redhat.com/support/policy/updates/openstack/platform


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