Bug 1230865

Summary: Cannot use HTTP PUT to associate organization with media
Product: Red Hat Satellite Reporter: jaudet
Component: APIAssignee: Martin Bacovsky <mbacovsk>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: mmccune, rnuccite
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:
: 1236008 (view as bug list) Environment:
Last Closed: 2017-08-01 20:13:24 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:
Bug Depends On:    
Bug Blocks: 1236008    
Attachments:
Description Flags
Output of foreman-debug from a Satellite 6.1 system on RHEL 6.6. none

Description jaudet 2015-06-11 16:17:55 UTC
Created attachment 1037774 [details]
Output of foreman-debug from a Satellite 6.1 system on RHEL 6.6.

Description of problem:
An organization can be associated with zero or more media. Unfortunately, it is impossible to update an organization's associations with media using an HTTP PUT request to the API.

Version-Release number of selected component (if applicable):
Tested against Satellite 6.1.0 GA 8. Foreman-debug is attached.

How reproducible:
100%

Steps to Reproduce:
1. Create an organization.
2. Create a media.
3. Issue an HTTP PUT request that updates the organization and associates it with the media.

Actual results:

    >>> from nailgun import entities
    >>> org = entities.Organization().create(create_missing=True)
    >>> org.media = [entities.Media().create(create_missing=True)]
    >>> org.update_payload(['media'])
    {u'organization': {'media_ids': [53]}}  # This is the JSON payload
    >>> response = org.update_raw(['media'])
    >>> response.status_code
    500
    >>> response.json()
    {u'error': {u'message': u'unknown attribute: media_ids'}}

Expected results:
The organization is successfully updated.

Additional info:
n/a

Comment 1 RHEL Program Management 2015-06-11 16:32:38 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 3 Bryan Kearney 2017-08-01 20:13:24 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in product in the forseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.