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.
Bug 1256461 - Unable to set paramteres at the location level
Summary: Unable to set paramteres at the location level
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: Unspecified
Assignee: Tomas Strachota
QA Contact: jcallaha
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On: 1221710 1361114
Blocks: 1315267
TreeView+ depends on / blocked
 
Reported: 2015-08-24 15:56 UTC by Andrew Schofield
Modified: 2019-11-14 06:54 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1315267 (view as bug list)
Environment:
Last Closed: 2016-09-27 09:01:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 12699 0 None None None 2016-04-26 17:11:26 UTC
Red Hat Product Errata RHBA-2016:1938 0 normal SHIPPED_LIVE Satellite 6.1.10 bug fix update 2016-09-27 12:56:10 UTC

Description Andrew Schofield 2015-08-24 15:56:05 UTC
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:

Comment 3 Tomas Strachota 2015-12-04 10:17:48 UTC
Created redmine issue http://projects.theforeman.org/issues/12699 from this bug

Comment 4 Bryan Kearney 2015-12-09 13:02:42 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/12699 has been closed
-------------
Anonymous
Applied in changeset commit:hammer-cli-foreman|14ce3fa48a16604ea023000ce0721a2a9c901db3.

Comment 6 Tazim Kolhar 2016-01-05 12:19:41 UTC
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

Comment 7 Tomas Strachota 2016-01-08 07:50:23 UTC
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.

Comment 8 Og Maciel 2016-01-13 18:19:27 UTC
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

Comment 9 Tazim Kolhar 2016-01-14 04:53:44 UTC
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

Comment 10 Bryan Kearney 2016-01-26 13:55:38 UTC
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.

Comment 11 Tomas Strachota 2016-02-29 13:45:19 UTC
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.

Comment 12 Tomas Strachota 2016-07-28 11:24:32 UTC
Still blocked by 1361114 which was not cherry-picked into 6.1 yet.

Comment 13 Tomas Strachota 2016-08-24 07:21:34 UTC
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

Comment 15 jcallaha 2016-09-20 19:36:58 UTC
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

Comment 16 jcallaha 2016-09-21 20:41:40 UTC
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

Comment 18 errata-xmlrpc 2016-09-27 09:01:23 UTC
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


Note You need to log in before you can comment on or make changes to this bug.