Project

General

Profile

Actions

Bug #26120

closed

Insufficient parsing capabilities of complex list type options

Added by Martin Bacovsky about 5 years ago. Updated almost 5 years ago.

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

Description

It is not possible to parse complex parameters of type list. E.g.

hammer os create --architectures amd64,i386 --description "Windows 7 EN (2019-01)" --major 6 --minor 1.7601 --family Windows --partition-tables Empty --password-hash SHA256 --provisioning-templates winpe_clone,winpe_finish,winpe_pxelinux_boot_clone,winpe_unattend_template --name Windows7EM2019-01 --os-parameters-attributes="test=1,other=2" 

Error: ApipieBindings::InvalidArgumentTypesError: operatingsystem[os_parameters_attributes][0] - Hash was expected, operatingsystem[os_parameters_attributes][1] - Hash was expected

The field is defined as a list of hashes in the API

          param :os_parameters_attributes, Array, :desc => N_("Array of parameters") do
            param :name, String, :desc => N_("Name of the parameter"), :required => true
            param :value, String, :desc => N_("Parameter value"), :required => true
          end

Related issues 1 (0 open1 closed)

Related to Hammer CLI - Bug #20348: Hammer Does Not Consistently Escape Quotes When Assigning JSON To A Host Parameter.ResolvedAditi PuntambekarActions
Actions

Also available in: Atom PDF