Bug 1256461
| Summary: | Unable to set paramteres at the location level | |||
|---|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Andrew Schofield <andrew.schofield> | |
| Component: | Hammer | Assignee: | Tomas Strachota <tstrachota> | |
| Status: | CLOSED ERRATA | QA Contact: | jcallaha | |
| Severity: | urgent | Docs Contact: | ||
| Priority: | urgent | |||
| Version: | 6.1.0 | CC: | bbuckingham, bkearney, cwelton, ehelms, jcallaha, kabbott, mmccune, omaciel, sthirugn | |
| Target Milestone: | Unspecified | Keywords: | Triaged | |
| Target Release: | Unused | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| URL: | http://projects.theforeman.org/issues/12699 | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | Bug Fix | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1315267 (view as bug list) | Environment: | ||
| Last Closed: | 2016-09-27 09:01:23 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: | 1221710, 1361114 | |||
| Bug Blocks: | 1315267 | |||
Created redmine issue http://projects.theforeman.org/issues/12699 from this bug Moving to POST since upstream bug http://projects.theforeman.org/issues/12699 has been closed ------------- Anonymous Applied in changeset commit:hammer-cli-foreman|14ce3fa48a16604ea023000ce0721a2a9c901db3. FAILEDQA:
# rpm -qa | grep foreman
dell-pe1950-05.rhts.eng.brq.redhat.com-foreman-client-1.0-1.noarch
dell-pe1950-05.rhts.eng.brq.redhat.com-foreman-proxy-1.0-1.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el7sat.noarch
puppet-foreman_scap_client-0.3.3-10.el7sat.noarch
foreman-vmware-1.7.2.50-1.el7sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.5-1.el7sat.noarch
foreman-ovirt-1.7.2.50-1.el7sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el7sat.noarch
foreman-1.7.2.50-1.el7sat.noarch
ruby193-rubygem-foreman_docker-1.2.0.24-1.el7sat.noarch
ruby193-rubygem-foreman-tasks-0.6.15.7-1.el7sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el7sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.10-1.el7sat.noarch
foreman-debug-1.7.2.50-1.el7sat.noarch
foreman-proxy-1.7.2.8-1.el7sat.noarch
dell-pe1950-05.rhts.eng.brq.redhat.com-foreman-proxy-client-1.0-1.noarch
foreman-discovery-image-3.0.5-3.el7sat.noarch
foreman-libvirt-1.7.2.50-1.el7sat.noarch
ruby193-rubygem-foreman_openscap-0.3.2.10-1.el7sat.noarch
foreman-gce-1.7.2.50-1.el7sat.noarch
rubygem-hammer_cli_foreman-0.1.4.15-1.el7sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.23-1.el7sat.noarch
foreman-selinux-1.7.2.17-1.el7sat.noarch
foreman-postgresql-1.7.2.50-1.el7sat.noarch
foreman-compute-1.7.2.50-1.el7sat.noarch
ruby193-rubygem-foreman-redhat_access-0.2.4-1.el7sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el7sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.14-1.el7sat.noarch
steps:
# hammer location update --help
Usage:
hammer location update [OPTIONS]
Options:
--compute-resource-ids COMPUTE_RESOURCE_IDS Comma separated list of values.
--compute-resources COMPUTE_RESOURCE_NAMES Comma separated list of values.
--config-template-ids CONFIG_TEMPLATE_IDS Comma separated list of values.
--config-templates CONFIG_TEMPLATE_NAMES Comma separated list of values.
--description DESCRIPTION
--domain-ids DOMAIN_IDS Numerical ID or domain name
Comma separated list of values.
--domains DOMAIN_NAMES Comma separated list of values.
--environment-ids ENVIRONMENT_IDS Comma separated list of values.
--environments ENVIRONMENT_NAMES Comma separated list of values.
--hostgroup-ids HOSTGROUP_IDS Comma separated list of values.
--hostgroups HOSTGROUP_NAMES Comma separated list of values.
--id ID Location numeric id to search by
--media MEDIUM_NAMES Comma separated list of values.
--media-ids MEDIA_IDS Media IDs
Comma separated list of values.
--medium-ids MEDIUM_IDS Comma separated list of values.
--name NAME
--new-name NEW_NAME
--realm-ids REALM_IDS Numerical ID or realm name
Comma separated list of values.
--realms REALM_NAMES Comma separated list of values.
--smart-proxies SMART_PROXY_NAMES Comma separated list of values.
--smart-proxy-ids SMART_PROXY_IDS Comma separated list of values.
--subnet-ids SUBNET_IDS Comma separated list of values.
--subnets SUBNET_NAMES Comma separated list of values.
--user-ids USER_IDS Comma separated list of values.
--users USER_LOGINS Comma separated list of values.
-h, --help print help
Tazim, please note that there are two new commands: hammer location set-parameter hammer location delete-parameter This is standard way of setting parameters across hammer. Actually the only place where we allow for using --parameters in update action is in host command. Tomas:
hammer> location create --name "Brand New Location"
Location created
hammer> location info --name "Brand New Location"
Id: 350
Name: Brand New Location
Users:
Smart proxies:
Subnets:
Compute resources:
Installation media:
Templates:
Boot disk iPXE - generic host (Bootdisk)
Boot disk iPXE - host (Bootdisk)
Discovery Red Hat kexec (kexec)
idm_register ()
Kickstart default iPXE (iPXE)
Kickstart default PXELinux (PXELinux)
kickstart_networking_setup ()
puppet.conf ()
PXELinux default local boot (PXELinux)
PXELinux global default (PXELinux)
Satellite Kickstart Default (provision)
Satellite Kickstart Default Finish (finish)
Satellite Kickstart Default User Data (user_data)
subscription_manager_registration ()
Domains:
Environments:
Hostgroups:
Parameters:
Created at: 2016/01/13 18:13:32
Updated at: 2016/01/13 18:13:32
hammer> location set-parameter --location "Brand New Location" --name 'owner' --value 'Location Owner'
Could not set location parameter:
undefined method `new' for {}:Hash
hammer> location set-parameter --location-id 350 --name 'owner' --value 'Location Owner'
Could not set location parameter:
undefined method `new' for {}:Hash
Hi Tomas, As per the comment https://bugzilla.redhat.com/show_bug.cgi?id=1256461#c0 it describes we should be able to update the parameters hence the help page for update: # hammer location update --help Usage: hammer location update [OPTIONS] Options: --compute-resource-ids COMPUTE_RESOURCE_IDS Comma separated list of values. --compute-resources COMPUTE_RESOURCE_NAMES Comma separated list of values. --config-template-ids CONFIG_TEMPLATE_IDS Comma separated list of values. --config-templates CONFIG_TEMPLATE_NAMES Comma separated list of values. --description DESCRIPTION --domain-ids DOMAIN_IDS Numerical ID or domain name Comma separated list of values. --domains DOMAIN_NAMES Comma separated list of values. --environment-ids ENVIRONMENT_IDS Comma separated list of values. --environments ENVIRONMENT_NAMES Comma separated list of values. --hostgroup-ids HOSTGROUP_IDS Comma separated list of values. --hostgroups HOSTGROUP_NAMES Comma separated list of values. --id ID Location numeric id to search by --media MEDIUM_NAMES Comma separated list of values. --media-ids MEDIA_IDS Media IDs Comma separated list of values. --medium-ids MEDIUM_IDS Comma separated list of values. --name NAME --new-name NEW_NAME --realm-ids REALM_IDS Numerical ID or realm name Comma separated list of values. --realms REALM_NAMES Comma separated list of values. --smart-proxies SMART_PROXY_NAMES Comma separated list of values. --smart-proxy-ids SMART_PROXY_IDS Comma separated list of values. --subnet-ids SUBNET_IDS Comma separated list of values. --subnets SUBNET_NAMES Comma separated list of values. --user-ids USER_IDS Comma separated list of values. --users USER_LOGINS Comma separated list of values. -h, --help print help But as per you comment : https://bugzilla.redhat.com/show_bug.cgi?id=1256461#c7 I get to know that these are new commands introduced under location and not location update : # hammer location --help Usage: hammer location [OPTIONS] SUBCOMMAND [ARG] ... Parameters: SUBCOMMAND subcommand [ARG] ... subcommand arguments Subcommands: delete-parameter Delete parameter for a location. set-parameter Create or update parameter for a location. update Update a location Options: -h, --help print help # hammer location set-parameter --location test_location --name test_key --value test_value [Foreman] Username: admin [Foreman] Password for admin: Could not set location parameter: undefined method `new' for {}:Hash So, we are still not able to set the parameter. What confused the verification is : 1.it mentions to check for `location update` for set-parameter and delete-parameters in description (comment#0) 2. then it mentions to check `location --help` to check for set-parameter and delete-parameter in (comment#7) Thanks, Tazim Moving this out of 6.1.7 due to capacity issues. Will keep it on the 6.1.z and 6.2 trackers to ensure that it is evaluated for both. The "undefined method" issue is caused by an API issue reported in BZ 1221710 (dependency added). It's fixed in the upstream but has not been cherry-picked yet. Once that issue is merged downstream, this one should be verifiable too. Still blocked by 1361114 which was not cherry-picked into 6.1 yet. Moving to ON_QA since the bug that was blocking the verification has been released in erratum https://access.redhat.com/errata/RHBA-2016:1500 Failed QA in Satellite 6.1.10. Still unable to set a parameter for a location.
[root@rhsm-qe-1 ~]# hammer location set-parameter --location "Brand New Location" --name 'owner' --value 'Location Owner'
Could not set location parameter:
undefined method `new' for {}:Hash
[root@rhsm-qe-1 ~]# hammer location set-parameter --location-id 3 --name 'owner' --value 'Location Owner'
Could not set location parameter:
undefined method `new' for {}:Hash
However, we do see the subcommands listed in help text.
[root@rhsm-qe-1 ~]# hammer location --help
Usage:
hammer location [OPTIONS] SUBCOMMAND [ARG] ...
Parameters:
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands:
add-compute-resource Associate a compute resource
add-config-template Associate a configuration template
add-domain Associate a domain
add-environment Associate an environment
add-hostgroup Associate a hostgroup
add-medium Associate a medium
add-organization Associate an organization
add-smart-proxy Associate a smart proxy
add-subnet Associate a subnet
add-user Associate an user
create Create a location
delete Delete a location
delete-parameter Delete parameter for a location.
info Show a location
list List all locations
remove-compute-resource Disassociate a compute resource
remove-config-template Disassociate a configuration template
remove-domain Disassociate a domain
remove-environment Disassociate an environment
remove-hostgroup Disassociate a hostgroup
remove-medium Disassociate a medium
remove-organization Disassociate an organization
remove-smart-proxy Disassociate a smart proxy
remove-subnet Disassociate a subnet
remove-user Disassociate an user
set-parameter Create or update parameter for a location.
update Update a location
Options:
-h, --help print help
Verified in Satellite 6.1.10 Snap 1.1. [root@rhsm-qe-1 ~]# hammer location set-parameter --location "Brand New Location" --name 'owner' --value 'Location Owner' Parameter [owner] created with value [Location Owner] [root@rhsm-qe-1 ~]# hammer location delete-parameter --location "Brand New Location" --name 'owner' Parameter [owner] deleted 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:1938 |
Description of problem: Unable to set / change paramters at the location level: # hammer location update --help Usage: hammer location update [OPTIONS] Options: --compute-resource-ids COMPUTE_RESOURCE_IDS Comma separated list of values. --compute-resources COMPUTE_RESOURCE_NAMES Comma separated list of values. --config-template-ids CONFIG_TEMPLATE_IDS Comma separated list of values. --config-templates CONFIG_TEMPLATE_NAMES Comma separated list of values. --description DESCRIPTION --domain-ids DOMAIN_IDS Numerical ID or domain name Comma separated list of values. --domains DOMAIN_NAMES Comma separated list of values. --environment-ids ENVIRONMENT_IDS Comma separated list of values. --environments ENVIRONMENT_NAMES Comma separated list of values. --hostgroup-ids HOSTGROUP_IDS Comma separated list of values. --hostgroups HOSTGROUP_NAMES Comma separated list of values. --id ID Location numeric id to search by --media MEDIUM_NAMES Comma separated list of values. --media-ids MEDIA_IDS Media IDs Comma separated list of values. --medium-ids MEDIUM_IDS Comma separated list of values. --name NAME --new-name NEW_NAME --realm-ids REALM_IDS Numerical ID or realm name Comma separated list of values. --realms REALM_NAMES Comma separated list of values. --smart-proxies SMART_PROXY_NAMES Comma separated list of values. --smart-proxy-ids SMART_PROXY_IDS Comma separated list of values. --subnet-ids SUBNET_IDS Comma separated list of values. --subnets SUBNET_NAMES Comma separated list of values. --user-ids USER_IDS Comma separated list of values. --users USER_LOGINS Comma separated list of values. -h, --help print help Version-Release number of selected component (if applicable): 6.1.1 GA How reproducible: Always. Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Paramters should be able to be set via the hammer tool. Additional info: