Project

General

Profile

Bug #9721

Arrays in key-value parameters can't contain spaces

Added by Tomáš Strachota over 6 years ago. Updated over 6 years ago.

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

Description

Arrays in key-value parameters currently can't contain spaces which is a bit unintuitive. Parsing of the following:

hammer host create --parameters packages='[vim, tmux]'

results in:

{"packages"=>["vim", " tmux"]}

Note the additional leading space in tmux.

Also

hammer host create --parameters formula='a=b+1'

gets parsed wrongly as:
{"formula=a"=>"b+1"}

but it's a minor issue.

Associated revisions

Revision 8df57d3e (diff)
Added by Tomáš Strachota over 6 years ago

Fixes #9721 - ignore spaces in key value formatting

Updates key-value format to ignore spaces unless they are explicitly
enclosed with quotes. Some examples of input and results of parsing
below:

--params "key=[ value1, value2 ]" {'key' => ['value1', 'value2']}

--params "key=' value with spaces '" {'key' => ' value with spaces '}

Revision fa53d05e
Added by Martin Bacovsky over 6 years ago

Merge pull request #164 from tstrachota/key_value_normalizer_9721

Fixes #9721 - ignore spaces in key value formatting

History

#1 Updated by The Foreman Bot over 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli/pull/164 added
  • Pull request deleted ()

#2 Updated by Tomáš Strachota over 6 years ago

  • Bugzilla link set to 1201364

#3 Updated by Anonymous over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF