Bug 1142821

Summary: --label is ignored by hammer organization create command
Product: Red Hat Satellite Reporter: Ales Dujicek <adujicek>
Component: APIAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED ERRATA QA Contact: Corey Welton <cwelton>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.0.4CC: adujicek, bbuckingham, cwelton, dcleal, erezende, oshtaier
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/11626
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 08:45:01 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:

Description Ales Dujicek 2014-09-17 13:12:35 UTC
Description of problem:

hammer does not set organization's label to given value

# hammer organization create  --name org1 --label org1-label
Organization created
# hammer organization info --name org1
...
Name:                   org1
Label:                  org1
...


Version-Release number of selected component (if applicable):
Satellite-6.0.4-RHEL-7-20140916.0

How reproducible:
always

Actual results:
label is same as name

Expected results:
label is set to given value

Comment 2 Dominic Cleal 2014-09-17 14:12:29 UTC
I can't replicate this:

[root@satellite1 ~]# hammer organization create  --name org1 --label org1-label
Organization created
[root@satellite1 ~]# tail /var/log/foreman/production.log
Processing by Katello::Api::V2::OrganizationsController#create as application/json;version=2
  Parameters: {"name"=>"org1", "label"=>"org1-label", "api_version"=>"v2", "organization"=>{"name"=>"org1", "label"=>"org1-label"}}
Authorized user admin(Admin User)
Expire fragment views/tabs_and_title_records-3 (1.4ms)
Expire fragment views/tabs_and_title_records-3 (0.4ms)
Completed 201 Created in 3779ms (Views: 196.6ms | ActiveRecord: 0.0ms)
[root@satellite1 ~]# hammer organization info --name org1
Id:                     4
Name:                   org1
Label:                  org1-label

Could you attach foreman-debug please?

Comment 4 Dominic Cleal 2014-09-18 08:53:54 UTC
It appears that the label parameter isn't being wrapped.  I'm not sure why it worked for me above, since it definitely doesn't now.  I suspect I might have been using a bad compose, the fix might already be in another BZ...

# hammer -d organization create  --name org4 --label org4-label

[ INFO 2014-09-18 04:52:18 API] POST /katello/api/organizations
[DEBUG 2014-09-18 04:52:18 API] Params: {
            "name" => "org4",
           "label" => "org4-label",
    "organization" => {
        "name" => "org4"
    }
}

Processing by Katello::Api::V2::OrganizationsController#create as application/json;version=2
  Parameters: {"name"=>"org4", "label"=>"org4-label", "organization"=>{"name"=>"org4"}, "api_version"=>"v2"}
Authorized user admin(Admin User)
Expire fragment views/tabs_and_title_records-3 (0.2ms)
Expire fragment views/tabs_and_title_records-3 (0.4ms)
Completed 201 Created in 1780ms (Views: 146.1ms | ActiveRecord: 0.0ms)

Name:                   org4
Label:                  org4

Comment 5 Brad Buckingham 2015-08-31 18:44:01 UTC
Created redmine issue http://projects.theforeman.org/issues/11626 from this bug

Comment 6 Bryan Kearney 2015-08-31 20:02:17 UTC
Upstream bug component is Content Management

Comment 7 Bryan Kearney 2015-09-01 18:02:04 UTC
Upstream bug component is API

Comment 8 Bryan Kearney 2015-10-12 20:01:40 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/11626 has been closed
-------------
Brad Buckingham
Applied in changeset commit:katello|a08199b78ceb149992f34cd4f56b0cab829d03fd.

Comment 9 Tazim Kolhar 2015-11-23 06:49:21 UTC
VERIFIED:
# rpm -qa | grep foreman
hp-dl360g7-01.lab.eng.brq.redhat.com-foreman-proxy-1.0-1.noarch
foreman-release-1.11.0-0.develop.201511161350git860ef06.el7.noarch
foreman-vmware-1.11.0-0.develop.201511161350git860ef06.el7.noarch
foreman-debug-1.11.0-0.develop.201511161350git860ef06.el7.noarch
foreman-libvirt-1.11.0-0.develop.201511161350git860ef06.el7.noarch
foreman-selinux-1.11.0-0.develop.201510071426git6234447.el7.noarch
tfm-rubygem-foreman_hooks-0.3.9-1.el7.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.8-1.el7.noarch
tfm-rubygem-foreman_gutterball-0.0.1-3.el7.noarch
foreman-postgresql-1.11.0-0.develop.201511161350git860ef06.el7.noarch
hp-dl360g7-01.lab.eng.brq.redhat.com-foreman-proxy-client-1.0-1.noarch
tfm-rubygem-foreman_discovery-4.1.2-1.fm1_11.el7.noarch
foreman-1.11.0-0.develop.201511161350git860ef06.el7.noarch
foreman-ovirt-1.11.0-0.develop.201511161350git860ef06.el7.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3-3.el7.noarch
foreman-proxy-1.11.0-0.develop.201511161424gitf24be74.el7.noarch
foreman-compute-1.11.0-0.develop.201511161350git860ef06.el7.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.3-4.el7.noarch
hp-dl360g7-01.lab.eng.brq.redhat.com-foreman-epeclient-1.0-1.noarch
tfm-rubygem-foreman_bootdisk-6.0.0-2.fm1_10.el7.noarch
tfm-rubygem-hammer_cli_foreman-0.4.0-1.201511111650gitdda13df.el7.noarch
foreman-gce-1.11.0-0.develop.201511161350git860ef06.el7.noarch
foreman-release-scl-1-1.el7.x86_64
tfm-rubygem-foreman_docker-1.4.1-2.fm1_10.el7.noarch
tfm-rubygem-foreman-tasks-0.7.6-1.fm1_10.el7.noarch

steps:
# hammer organization create --name org1 --label org1-label
[Foreman] Password for admin: 
Organization created

# hammer organization info --name org1
[Foreman] Password for admin: 
Id:                     3
Name:                   org1
Label:                  org1-label

Comment 11 Oleksandr Shtaier 2016-04-19 07:33:47 UTC
Verified on downstream 6.2 SNAP 8.2

hammer -u user -p pass organization create --name org1 --label org1-label
Organization created

hammer -u admin -p pass organization info --name org1
Id:                     1787
Name:                   org1
Users:                  

Smart proxies:          
    server....
Subnets:                

Compute resources:      

Installation media:     

Templates:              
    Alterator default (provision)
    Alterator default finish (finish)
    Alterator default PXELinux (PXELinux)
    alterator_pkglist ()
    Atomic Kickstart default (provision)
    AutoYaST default (provision)
    AutoYaST default iPXE (iPXE)
    AutoYaST default PXELinux (PXELinux)
    AutoYaST SLES default (provision)
    Boot disk iPXE - generic host (Bootdisk)
    Boot disk iPXE - host (Bootdisk)
    chef_client ()
    coreos_cloudconfig ()
    CoreOS provision (provision)
    CoreOS PXELinux (PXELinux)
    Discovery Red Hat kexec (kexec)
    epel ()
    fix_hosts ()
    FreeBSD (mfsBSD) finish (finish)
    FreeBSD (mfsBSD) provision (provision)
    FreeBSD (mfsBSD) PXELinux (PXELinux)
    freeipa_register ()
    Grubby default (script)
    http_proxy ()
    Jumpstart default (provision)
    Jumpstart default finish (finish)
    Jumpstart default PXEGrub (PXEGrub)
    Junos default finish (finish)
    Junos default SLAX (provision)
    Junos default ZTP config (ZTP)
    Katello Atomic Kickstart Default (provision)
    Katello Kickstart Default (provision)
    Katello Kickstart Default Finish (finish)
    Katello Kickstart Default User Data (user_data)
    Kickstart default (provision)
    Kickstart default finish (finish)
    Kickstart default iPXE (iPXE)
    Kickstart default PXELinux (PXELinux)
    Kickstart default user data (user_data)
    kickstart_networking_setup ()
    Kickstart RHEL default (provision)
    NX-OS default POAP setup (POAP)
    Preseed default (provision)
    Preseed default finish (finish)
    Preseed default iPXE (iPXE)
    Preseed default PXELinux (PXELinux)
    Preseed default user data (user_data)
    preseed_networking_setup ()
    puppet.conf ()
    PXEGrub default local boot (PXEGrub)
    PXELinux chain iPXE (PXELinux)
    PXELinux chain iPXE UNDI (PXELinux)
    PXELinux default local boot (PXELinux)
    PXELinux default memdisk (PXELinux)
    PXELinux global default (PXELinux)
    redhat_register ()
    remote_execution_ssh_keys ()
    saltstack_minion ()
    subscription_manager_registration ()
    UserData default (user_data)
    WAIK default PXELinux (PXELinux)
Domains:                

Environments:           

Hostgroups:             

Parameters:             

Created at:             2016/04/19 07:29:27
Updated at:             2016/04/19 07:29:27
Label:                  org1-label
Description:            
Red Hat Repository URL: https://cdn.redhat.com

Comment 14 errata-xmlrpc 2016-07-27 08:45:01 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:1500