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 1102331 - hammer hostroup create & update requires all options as ids.
Summary: hammer hostroup create & update requires all options as ids.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Tomas Strachota
QA Contact: jcallaha
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On: 1101657
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-28 19:03 UTC by Justin Sherrill
Modified: 2019-09-25 21:14 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:28:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 8299 0 None None None 2016-04-22 15:47:34 UTC

Description Justin Sherrill 2014-05-28 19:03:10 UTC
Description of problem:

Looking at hammer hostgroup create --help:

[root@box ~]# hammer hostgroup create --help
Usage:
    hammer hostgroup create [OPTIONS]

Options:
    --architecture-id ARCHITECTURE_ID  
    --domain-id DOMAIN_ID          
    --environment-id ENVIRONMENT_ID  
    --medium-id MEDIUM_ID          
    --name NAME                    
    --operatingsystem-id OPERATINGSYSTEM_ID  
    --parent-id PARENT_ID          
    --ptable-id PTABLE_ID          
    --puppet-ca-proxy-id PUPPET_CA_PROXY_ID  
    --puppet-proxy-id PUPPET_PROXY_ID  
    --puppetclass-ids PUPPETCLASS_IDS Comma separated list of values.
    --realm-id REALM_ID            
    --subnet-id SUBNET_ID          
    -h, --help                    print help


The following options require you to specify an id:

    --architecture-id ARCHITECTURE_ID  
    --domain-id DOMAIN_ID          
    --environment-id ENVIRONMENT_ID  
    --medium-id MEDIUM_ID          
    --operatingsystem-id OPERATINGSYSTEM_ID  
    --parent-id PARENT_ID          
    --ptable-id PTABLE_ID          
    --puppet-ca-proxy-id PUPPET_CA_PROXY_ID  
    --puppet-proxy-id PUPPET_PROXY_ID  
    --puppetclass-ids PUPPETCLASS_IDS Comma separated list of values.
    --realm-id REALM_ID            
    --subnet-id SUBNET_ID


There should be someway to do all this without referencing the ID.

Comment 2 Justin Sherrill 2014-05-30 16:21:29 UTC
Same for host create, i can file another BZ if desired.

Comment 3 Bryan Kearney 2014-06-04 20:27:48 UTC
This is fixed by https://bugzilla.redhat.com/show_bug.cgi?id=1101657. I am moving this to ON_QA. Please do not test this until you see that https://bugzilla.redhat.com/show_bug.cgi?id=1101657 has been moved to ON_QA.

Comment 4 sthirugn@redhat.com 2014-08-06 18:18:16 UTC
Failed.  

Out of the items requested in the bug, the following still doesnt show name options:

    --operatingsystem-id OPERATINGSYSTEM_ID
    --puppet-ca-proxy-id PUPPET_CA_PROXY_ID  
    --puppet-proxy-id PUPPET_PROXY_ID  
    --puppetclass-ids PUPPETCLASS_IDS Comma separated list of values.


hammer> hostgroup create --help
Usage:
     hostgroup create [OPTIONS]

Options:
    --architecture ARCHITECTURE_NAME Architecture name
    --architecture-id ARCHITECTURE_ID  
    --domain DOMAIN_NAME          Domain name
    --domain-id DOMAIN_ID         May be numerical id or domain name
    --environment ENVIRONMENT_NAME Environment name
    --environment-id ENVIRONMENT_ID  
    --medium MEDIUM_NAME          Medium name
    --medium-id MEDIUM_ID          
    --name NAME                    
    --operatingsystem-id OPERATINGSYSTEM_ID  
    --parent-id PARENT_ID          
    --ptable PTABLE_NAME          Partition table name
    --ptable-id PTABLE_ID          
    --puppet-ca-proxy-id PUPPET_CA_PROXY_ID  
    --puppet-proxy-id PUPPET_PROXY_ID  
    --puppetclass-ids PUPPETCLASS_IDS Comma separated list of values.
    --realm REALM_NAME            Name to search by
    --realm-id REALM_ID           May be numerical id or realm name
    --subnet SUBNET_NAME          Subnet name
    --subnet-id SUBNET_ID          
    -h, --help                    print help


Version Tested:
Satellite-6.0.4-RHEL-6-20140730.0

* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.19-1.el6_5.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.9.19-1.el6_5.noarch
* candlepin-tomcat6-0.9.19-1.el6_5.noarch
* elasticsearch-0.90.10-4.el6sat.noarch
* foreman-1.6.0.34-1.el6sat.noarch
* foreman-compute-1.6.0.34-1.el6sat.noarch
* foreman-gce-1.6.0.34-1.el6sat.noarch
* foreman-libvirt-1.6.0.34-1.el6sat.noarch
* foreman-ovirt-1.6.0.34-1.el6sat.noarch
* foreman-postgresql-1.6.0.34-1.el6sat.noarch
* foreman-proxy-1.6.0.23-1.el6sat.noarch
* foreman-selinux-1.6.0.4-1.el6sat.noarch
* foreman-vmware-1.6.0.34-1.el6sat.noarch
* katello-1.5.0-27.el6sat.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.6-1.el6sat.noarch
* katello-installer-0.0.56-1.el6sat.noarch
* openldap-2.4.23-34.el6_5.1.x86_64
* pulp-katello-0.3-3.el6sat.noarch
* pulp-nodes-common-2.4.0-0.23.beta.el6sat.noarch
* pulp-nodes-parent-2.4.0-0.23.beta.el6sat.noarch
* pulp-puppet-plugins-2.4.0-0.23.beta.el6sat.noarch
* pulp-puppet-tools-2.4.0-0.23.beta.el6sat.noarch
* pulp-rpm-plugins-2.4.0-0.23.beta.el6sat.noarch
* pulp-selinux-2.4.0-0.23.beta.el6sat.noarch
* pulp-server-2.4.0-0.23.beta.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
* ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch
* sssd-ldap-1.11.5.1-3.el6.x86_64

Comment 5 Tomas Strachota 2014-08-14 13:38:53 UTC
Created redmine issue http://projects.theforeman.org/issues/7085 from this bug

Comment 6 Tomas Strachota 2014-08-15 09:53:06 UTC
I'm adding --puppet-ca-proxy and --puppet-proxy in an upstream PR https://github.com/theforeman/hammer-cli-foreman/pull/147

I'm afraid the rest is not currently fixable. Operating systems don't have unique names and are referenced by ids across the whole cli.

We also don't support name to id translation for lists yet, which is the case of all *-ids options.

Comment 7 Tomas Strachota 2014-08-19 11:42:08 UTC
commit 1eca7638229e056e9be4db5ae1c07072fc26bc04
Author: Tomas Strachota <tstrachota>
Date:   Thu Aug 14 14:40:14 2014 +0000

    Fixes #7085 - name options for puppet proxies in hostgroup

Comment 8 Tazim Kolhar 2014-10-10 12:43:45 UTC
FAILED

*** This bug is verified in upstream.  This fix should eventually land in future downstream builds ***

# rpm -qa | grep foreman
foreman-gce-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
ruby193-rubygem-foreman_discovery-1.4.0-0.1.rc4.el7.noarch
hp-bl420cgen8-01.rhts.eng.bos.redhat.com-foreman-proxy-1.0-1.noarch
foreman-compute-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el7.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-2.201409091410git163c264.git.0.988ca80.el7.noarch
foreman-release-1.7.0-0.develop.201410071158git54141ab.el7.noarch
foreman-proxy-1.7.0-0.develop.201410081229git52f0bac.el7.noarch
hp-bl420cgen8-01.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
foreman-ovirt-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
ruby193-rubygem-foreman-tasks-0.6.9-1.el7.noarch
foreman-selinux-1.7.0-0.develop.201409301113git2f345de.el7.noarch
foreman-postgresql-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
foreman-vmware-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
ruby193-rubygem-foreman_bootdisk-4.0.0-1.el7.noarch
foreman-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
foreman-libvirt-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
rubygem-hammer_cli_foreman-0.1.3-1.201409191432gitc38f9c8.el7.noarch

Out of the items requested in the bug, the following still doesnt show name options:


 --location-ids LOCATION_IDS             REPLACE locations with given ids
                                         Comma separated list of values.
                  
 --operatingsystem-id OPERATINGSYSTEM_ID  
 --organization-ids ORGANIZATION_IDS     REPLACE organizations with given ids.
                                         Comma separated list of values.
 --parent-id PARENT_ID                    
 
 --puppetclass-ids PUPPETCLASS_IDS       List of puppetclass ids
                                         Comma separated list of values.
 


# hammer hostgroup create --help
[Foreman] username: admin
[Foreman] password for admin: 
Usage:
    hammer hostgroup create [OPTIONS]

Options:
 --architecture ARCHITECTURE_NAME        Architecture name
 --architecture-id ARCHITECTURE_ID        
 --domain DOMAIN_NAME                    Domain name
 --domain-id DOMAIN_ID                   Numerical ID or domain name
 --environment ENVIRONMENT_NAME          Environment name
 --environment-id ENVIRONMENT_ID          
 --location-ids LOCATION_IDS             REPLACE locations with given ids
                                         Comma separated list of values.
 --medium MEDIUM_NAME                    Medium name
 --medium-id MEDIUM_ID                    
 --name NAME                              
 --operatingsystem-id OPERATINGSYSTEM_ID  
 --organization-ids ORGANIZATION_IDS     REPLACE organizations with given ids.
                                         Comma separated list of values.
 --parent-id PARENT_ID                    
 --ptable PTABLE_NAME                    Partition table name
 --ptable-id PTABLE_ID                    
 --puppet-ca-proxy PUPPET_CA_PROXY_NAME  Name of puppet CA proxy
 --puppet-ca-proxy-id PUPPET_CA_PROXY_ID  
 --puppet-proxy PUPPET_PROXY_NAME        Name of puppet proxy
 --puppet-proxy-id PUPPET_PROXY_ID        
 --puppetclass-ids PUPPETCLASS_IDS       List of puppetclass ids
                                         Comma separated list of values.
 --realm REALM_NAME                      Name to search by
 --realm-id REALM_ID                     Numerical ID or realm name
 --subnet SUBNET_NAME                    Subnet name
 --subnet-id SUBNET_ID                    
 -h, --help                              print help

Comment 9 Tomas Strachota 2015-10-19 12:01:55 UTC
Moving to ON_QA since the required patches are contained in Sat 6.1.3 and the issue is fixed there.

Comment 10 jcallaha 2015-10-29 19:33:40 UTC
Verified in upstream. All specified parameters now have a corresponding name parameter to be used.

 HOSTNAME: rhsm-qe-1.rhq.lab.eng.bos.redhat.com
       OS: redhat
  RELEASE: Red Hat Enterprise Linux Server release 7.1 (Maipo)
  FOREMAN: 1.11.0-develop
     RUBY: ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
   PUPPET: 3.8.3
  DENIALS: 0

Options:
 --architecture ARCHITECTURE_NAME                    Architecture name
 --architecture-id ARCHITECTURE_ID                    
 --ask-root-pass ASK_ROOT_PW                         One of true/false, yes/no, 1/0.
 --content-source-id CONTENT_SOURCE_ID                
 --content-view CONTENT_VIEW_NAME                    Name to search by
 --content-view-id CONTENT_VIEW_ID                   content view numeric identifier
 --domain DOMAIN_NAME                                Domain name
 --domain-id DOMAIN_ID                               Numerical ID or domain name
 --environment ENVIRONMENT_NAME                      Environment name
 --environment-id ENVIRONMENT_ID                      
 --lifecycle-environment LIFECYCLE_ENVIRONMENT_NAME  Name to search by
 --lifecycle-environment-id LIFECYCLE_ENVIRONMENT_ID ID of the environment
 --location-ids LOCATION_IDS                         REPLACE locations with given ids
                                                     Comma separated list of values.
 --locations LOCATION_NAMES                          Comma separated list of values.
 --medium MEDIUM_NAME                                Medium name
 --medium-id MEDIUM_ID                                
 --name NAME                                          
 --operatingsystem OPERATINGSYSTEM_TITLE             Operating system title
 --operatingsystem-id OPERATINGSYSTEM_ID              
 --organization-ids ORGANIZATION_IDS                 REPLACE organizations with given ids.
                                                     Comma separated list of values.
 --organizations ORGANIZATION_NAMES                  Comma separated list of values.
 --parent PARENT_NAME                                Name of parent hostgroup
 --parent-id PARENT_ID                                
 --partition-table PARTITION_TABLE_NAME              Partition table name
 --partition-table-id PARTITION_TABLE_ID              
 --puppet-ca-proxy PUPPET_CA_PROXY_NAME              Name of puppet CA proxy
 --puppet-ca-proxy-id PUPPET_CA_PROXY_ID              
 --puppet-class-ids PUPPETCLASS_IDS                  List of puppetclass ids
                                                     Comma separated list of values.
 --puppet-classes PUPPET_CLASS_NAMES                 Comma separated list of values.
 --puppet-proxy PUPPET_PROXY_NAME                    Name of puppet proxy
 --puppet-proxy-id PUPPET_PROXY_ID                    
 --realm REALM_NAME                                  Name to search by
 --realm-id REALM_ID                                 Numerical ID or realm name
 --root-pass ROOT_PASSWORD                           Root password
 --subnet SUBNET_NAME                                Subnet name
 --subnet-id SUBNET_ID

Comment 13 Bryan Kearney 2016-07-27 11:28:13 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:1501


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