Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1687752

Summary: hammer host create --owner assumes user even with --owner-type Usergroup
Product: Red Hat Satellite Reporter: Mirek Długosz <mzalewsk>
Component: HostsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Mirek Długosz <mzalewsk>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: inecas, jhutar
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-01 14:15:11 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:
Embargoed:

Description Mirek Długosz 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

Comment 2 Bryan Kearney 2020-05-01 14:15:11 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.