Bug 1687752 - hammer host create --owner assumes user even with --owner-type Usergroup
Summary: hammer host create --owner assumes user even with --owner-type Usergroup
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hosts
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
low vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Mirek Zalewski
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-12 10:11 UTC by Mirek Zalewski
Modified: 2019-08-12 19:38 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1603219 None VERIFIED '--owner' key/value not recognized anymore with 'hammer host create' (Satellite 6.3.2) 2019-03-29 14:03:47 UTC

Description Mirek Zalewski 2019-03-12 10:11:05 UTC
`hammer host create` flag --owner-id meaning changes depending on --owner-type value - it may mean user or usergroup id, with user assumed by default.

This command understands also --owner flag, but it always refers to User. Even if --owner-type Usergroup is passed.

--owner meaning should be consistent with --owner-id meaning and depend on --owner-type value, assuming User if --owner-type is not passed.

This was found during testing of Bug 1603219.


Steps to reproduce:
1. hammer host create --name bz1603219-usergroup --hostgroup-id 1 --organization "Default Organization" --location "Default Location" --build true --owner-type Usergroup --owner bz1603219-usergroup --domain nodhcp.local --model-id 1 --interface ip=192.168.100.32,mac=52:54:00:fb:4e:16,subnet_id=1,primary=true,managed=true,provision=true --root-password redhatredhat


Actual results:
Could not create the host:
  Error: user not found.


Expected results:
Host is created.
In new host, owner type is set to Usergroup and owner is set to usergroup with name passed in command line.


Version:
Satellite 6.5 snap 18
tfm-rubygem-katello-3.10.0.24-1.el7sat.noarch
foreman-1.20.1.10-1.el7sat.noarch
pulp-server-2.18.0-0.1.rc.el7sat.noarch
satellite-6.5.0-6.beta.el7sat.noarch
tfm-rubygem-hammer_cli_katello-0.16.0.9-1.el7sat.noarch


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