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
Status: NEW
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hosts
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
low vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Mirek Zalewski
Depends On:
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:
Last Closed:
Target Upstream Version:

Attachments (Terms of Use)

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=,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.

Satellite 6.5 snap 18

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