Project

General

Profile

Actions

Bug #7433

closed

Cant specify comma spaced lists as values to the --parameters option.

Added by Dominic Cleal over 9 years ago. Updated over 9 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Hammer core
Target version:
-
Difficulty:
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1141671
++ This bug was initially created as a clone of Bug #1140393 ++

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):
  1. 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.


Related issues 1 (0 open1 closed)

Is duplicate of Hammer CLI - Bug #7133: Key-value option normalizer does not accept arraysClosedTomáš Strachota08/18/2014Actions
Actions #1

Updated by Dominic Cleal over 9 years ago

  • Category set to Hammer core

Looks like the key/value normaliser doesn't support quoting at all.

Actions #2

Updated by Martin Bacovsky over 9 years ago

  • Is duplicate of Bug #7133: Key-value option normalizer does not accept arrays added
Actions #3

Updated by Martin Bacovsky over 9 years ago

  • Status changed from New to Duplicate
Actions

Also available in: Atom PDF