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.
DescriptionChristophe Augello
2015-12-17 09:26:52 UTC
Description of problem:
hammer fails with parameters that contains a comma
Version-Release number of selected component (if applicable):
6.1.5
How reproducible:
100%
Steps to Reproduce:
Run a hammer command where a parameter contains a coma:
hammer --debug host create --subnet-id 3 --domain-id 2 --name testtest --organization-id 3 --location-id 2 --operatingsystem-id 1 --hostgroup-id 1 --mac AA:BB:CC:DD:EE:H1 --parameters bridges='[["bridge0.20","bond0.20"],["bridge1","bond1"]]'
hammer --debug host create --subnet-id 3 --domain-id 2 --name testtest --organization-id 3 --location-id 2 --operatingsystem-id 1 --hostgroup-id 1 --mac AA:BB:CC:DD:EE:H1 --parameters bridges='a,b'
Actual results:
Clamp::UsageError (option '--parameters': value must be defined as a comma-separated list of key=value):
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/option/parsing.rb:34:in `rescue in parse_options'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/option/parsing.rb:31:in `parse_options'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:52:in `parse'
/usr/share/gems/gems/hammer_cli-0.1.4.13/lib/hammer_cli/abstract.rb:31:in `parse'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:66:in `run'
/usr/share/gems/gems/hammer_cli-0.1.4.13/lib/hammer_cli/abstract.rb:23:in `run'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/share/gems/gems/hammer_cli-0.1.4.13/lib/hammer_cli/abstract.rb:23:in `run'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/share/gems/gems/hammer_cli-0.1.4.13/lib/hammer_cli/abstract.rb:23:in `run'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
/usr/share/gems/gems/hammer_cli-0.1.4.13/bin/hammer:108:in `<top (required)>'
/usr/bin/hammer:23:in `load'
/usr/bin/hammer:23:in `<main>'
Expected results:
When the value of a key is between quotes, handle it as a string and ignore the commas.
Additional info:
Same parameters trough webui works and values are saved as string in db.
[#<HostParameter id: 46, name: "bridges", value: "[[\"bridge0.20\",\"bond0.20\"],[\"bridge1\",\"bond1\"]]", reference_id: 109, created_at: "2015-12-17 08:19:06", updated_at: "2015-12-17 08:19:06", type: "HostParameter", priority: 4, hidden_value: false>]
Unfortunately capabilities of the current format are quite limited. You can only enter either --parameters='key1=value1,key2=value2' or --parameters='key1=[val1,val2,val3]'.
Would it be acceptable if we added support for json format with backward compatibility with the current one? Parameters could be then entered as both:
--parameters='key1=value1'
or
--parameters='{"key1": "value1", "nested": {"array": [1, 2]}}'
We have json parameters already in the hammer so the implementation should be trivial.
Moving to POST since upstream bug http://projects.theforeman.org/issues/12869 has been closed
-------------
Anonymous
Applied in changeset commit:1c83d898364270ac7f00eef171d5b2a964e04d25.
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/RHBA-2016:1501
Description of problem: hammer fails with parameters that contains a comma Version-Release number of selected component (if applicable): 6.1.5 How reproducible: 100% Steps to Reproduce: Run a hammer command where a parameter contains a coma: hammer --debug host create --subnet-id 3 --domain-id 2 --name testtest --organization-id 3 --location-id 2 --operatingsystem-id 1 --hostgroup-id 1 --mac AA:BB:CC:DD:EE:H1 --parameters bridges='[["bridge0.20","bond0.20"],["bridge1","bond1"]]' hammer --debug host create --subnet-id 3 --domain-id 2 --name testtest --organization-id 3 --location-id 2 --operatingsystem-id 1 --hostgroup-id 1 --mac AA:BB:CC:DD:EE:H1 --parameters bridges='a,b' Actual results: Clamp::UsageError (option '--parameters': value must be defined as a comma-separated list of key=value): /usr/share/gems/gems/clamp-0.6.2/lib/clamp/option/parsing.rb:34:in `rescue in parse_options' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/option/parsing.rb:31:in `parse_options' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:52:in `parse' /usr/share/gems/gems/hammer_cli-0.1.4.13/lib/hammer_cli/abstract.rb:31:in `parse' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:66:in `run' /usr/share/gems/gems/hammer_cli-0.1.4.13/lib/hammer_cli/abstract.rb:23:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.4.13/lib/hammer_cli/abstract.rb:23:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.4.13/lib/hammer_cli/abstract.rb:23:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run' /usr/share/gems/gems/hammer_cli-0.1.4.13/bin/hammer:108:in `<top (required)>' /usr/bin/hammer:23:in `load' /usr/bin/hammer:23:in `<main>' Expected results: When the value of a key is between quotes, handle it as a string and ignore the commas. Additional info: Same parameters trough webui works and values are saved as string in db. [#<HostParameter id: 46, name: "bridges", value: "[[\"bridge0.20\",\"bond0.20\"],[\"bridge1\",\"bond1\"]]", reference_id: 109, created_at: "2015-12-17 08:19:06", updated_at: "2015-12-17 08:19:06", type: "HostParameter", priority: 4, hidden_value: false>]