Bug 1141671
Summary: | Cant specify comma spaced lists as values to the --parameters option. | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Dominic Cleal <dcleal> |
Component: | Hammer | Assignee: | Tomas Strachota <tstrachota> |
Status: | CLOSED ERRATA | QA Contact: | Marek Hulan <mhulan> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.0.2 | CC: | bkearney, erezende, joherr, mbacovsk, mburns, mhulan, ohochman, rhos-maint, srevivo, sthirugn |
Target Milestone: | Unspecified | Keywords: | Reopened, Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Linux | ||
URL: | http://projects.theforeman.org/issues/7133 | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | 1140393 | Environment: | |
Last Closed: | 2016-07-27 11:41:31 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1272979 | ||
Bug Blocks: | 1140393 |
Description
Dominic Cleal
2014-09-15 08:03:04 UTC
Created redmine issue http://projects.theforeman.org/issues/7433 from this bug 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" Connecting redmine issue http://projects.theforeman.org/issues/7133 from this bug Failed on: Satellite-6.1.0-RHEL-7-20150303.0 # rpm -qa | grep hammer rubygem-hammer_cli_foreman_discovery-0.0.1.2-1.el7sat.noarch rubygem-hammer_cli_katello-0.0.7.3-1.el7sat.noarch rubygem-hammer_cli_foreman_bootdisk-0.1.2.5-1.el7sat.noarch rubygem-hammer_cli_import-0.10.6.3-1.el7sat.noarch rubygem-hammer_cli-0.1.4.3-1.el7sat.noarch rubygem-hammer_cli_foreman-0.1.4.6-1.el7sat.noarch rubygem-hammer_cli_gutterball-0.0.1.2-1.el7sat.noarch rubygem-hammer_cli_foreman_tasks-0.0.3.3-1.el7sat.noarch Tried to run using the same example in the steps to reproduce: [root@rhsm-qe-4 ~]# hammer -u admin -p changeme host create --name "bass" --mac "aa:aa:aa:dd:ee:ff" --domain-id 1 --location-id 2 --organization-id 1 --environment-id 1 --architecture-id 1 --operatingsystem-id 1 --medium-id 8 --partition-table-id 7 --root-password "password" --puppet-proxy-id 1 --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 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' Also tried to wrap into single quotes the parameters value: [root@sat6 ~]# hammer -u admin -p changeme host create --name "bass" --mac "aa:aa:aa:dd:ee:ff" --domain-id 1 --location-id 2 --organization-id 1 --environment-id 1 --architecture-id 1 --operatingsystem-id 1 --medium-id 8 --partition-table-id 7 --root-password "password" --puppet-proxy-id 1 --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' 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' Elyézer, the format of specifying arrays in key-value parameters is actually a bit different. Martin describes it in a comment above. You need to enclose the list by []. In your commant it would be: --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' Note the brackets after subscription_manager_repos= Can you verify the command works when you use square brackets, please? FYI I came accross a different issue with key-values params when I tested this one. Reported here: https://bugzilla.redhat.com/show_bug.cgi?id=1201364 Using the recommended format also does not work: # hammer -u admin -p changeme host create --name "bass" --mac "aa:aa:aa:dd:ee:ff" --domain-id 1 --location-id 2 --organization-id 1 --environment-id 1 --architecture-id 1 --operatingsystem-id 1 --medium-id 8 --partition-table-id 7 --root-password "password" --puppet-proxy-id 1 --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' Could not create the host: undefined method `strip!' for #<Array:0x0000000e09b3f8> There's another issue that prevents from setting parameters on hosts: http://projects.theforeman.org/issues/10547 Upstream patch created and ready for review. 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/RHSA-2015:1592 Accidentally closed with 6.1.1 errata Verified. Version Tested: satellite-6.2.0-14.2.el7sat.noarch Following command worked as expected hammer host create --managed false --name "test2.example.org" --build false --environment-id 1 --location 'Default Location' --organization 'Default Organization' --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' Additional information: rpm -qa | grep hammer tfm-rubygem-hammer_cli-0.5.1.10-1.el7sat.noarch tfm-rubygem-hammer_cli_foreman_remote_execution-0.0.5.3-1.el7sat.noarch tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3.2-1.el7sat.noarch tfm-rubygem-hammer_cli_foreman_tasks-0.0.10.2-1.el7sat.noarch tfm-rubygem-hammer_cli_katello-0.0.22.13-2.el7sat.noarch tfm-rubygem-hammer_cli_foreman_docker-0.0.5-1.el7sat.noarch tfm-rubygem-hammer_cli_csv-2.0.0.1-1.el7sat.noarch tfm-rubygem-hammer_cli_import-0.10.23-1.el7sat.noarch tfm-rubygem-hammer_cli_foreman-0.5.1.8-1.el7sat.noarch tfm-rubygem-hammer_cli_foreman_discovery-0.0.2.2-1.el7sat.noarch 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 |