Bug 1203865

Summary: An owner_type of "Usergroup" is ignored when creating a host
Product: Red Hat Satellite Reporter: jaudet
Component: HostsAssignee: Shimon Shtein <sshtein>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bbuckingham, bkearney, inecas, katello-qa-list, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 20:01:54 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 jaudet 2015-03-19 19:24:33 UTC
Description of problem:
When creating or updating a host, it is possible to specify an owner_type. From the API docs:

> host[owner_type]
> optional , nil allowed
> Host's owner type
> Value: Must be one of: User, Usergroup.

The "owner_type" attribute is set to "User" when creating a host, even if one provides a value of "Usergroup".

Version-Release number of selected component (if applicable):
Tested against Satellite-6.1.0-RHEL-6-20150317.0 and Satellite-6.1.0-RHEL-7-20150317.0.

How reproducible:
Always.

Steps to Reproduce:
1. Create a host. Specify an owner_type of "Usergroup".
2. Read back information about the just-created host. Examine the owner_type attribute.

Actual results:
A host is created with an owner type of "User".

Expected results:
A host is created with an owner type of "Usergroup".

Additional info:

Comment 1 jaudet 2015-03-19 19:30:03 UTC
An automated test for this bug will be added to QE's test suite shortly. See https://github.com/SatelliteQE/robottelo/pull/2005

Comment 3 RHEL Program Management 2015-03-19 19:43:10 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 7 jaudet 2015-07-06 16:46:57 UTC
If some mistake has been made while updating a host, then the server should return an HTTP 422 error giving some indication of such. To simply return an HTTP success status code and ignore the failures is bad behaviour.

Comment 8 Bryan Kearney 2016-08-04 20:09:58 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 10 Ivan Necas 2016-08-16 11:58:58 UTC
Created redmine issue http://projects.theforeman.org/issues/16125 from this bug

Comment 11 Bryan Kearney 2016-08-17 18:06:20 UTC
Upstream bug assigned to sshtein

Comment 12 Bryan Kearney 2016-08-17 18:06:23 UTC
Upstream bug assigned to sshtein

Comment 13 Bryan Kearney 2016-09-13 10:06:33 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16125 has been resolved.

Comment 14 Bryan Kearney 2017-08-01 20:01:54 UTC
The fix to this bug will be delivered with release 6.3 of Satellite.