Bug 1219791 - apipie content host update should not require facts
Summary: apipie content host update should not require facts
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.0.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Tom McKay
QA Contact: Tazim Kolhar
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-08 09:37 UTC by Tom McKay
Modified: 2019-09-26 18:07 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-26 14:12:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Output of foreman-debug from the Satellite 6.1 RHEL 7.1 system used for testing. (424.23 KB, application/x-xz)
2015-05-22 21:03 UTC, jaudet
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 10424 0 None None None 2016-04-22 16:17:10 UTC

Description Tom McKay 2015-05-08 09:37:53 UTC
Updating content host via apipie now requires facts (since the change in apipie to enforce that flag). That param should not be required.

Comment 1 Tom McKay 2015-05-08 09:37:54 UTC
Created from redmine issue http://projects.theforeman.org/issues/10424

Comment 2 Tom McKay 2015-05-08 09:37:56 UTC
Upstream bug assigned to tomckay

Comment 4 Tom McKay 2015-05-08 09:48:26 UTC
Needed for hammer-cli-csv (SAM-1.4 to SAM-6.1 migration)

Comment 5 Bryan Kearney 2015-05-12 16:06:41 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/10424 has been closed
-------------
Thomas McKay
Applied in changeset commit:katello|566f4a13c54802e4de032deeb9b4eb0de5dea233.

Comment 8 Tazim Kolhar 2015-05-13 13:49:59 UTC
hi

please provide verification steps

thanks

Comment 9 Tom McKay 2015-05-18 11:42:21 UTC
To verify: Call the api via apipie bindings to update a content host. Prior to this fix the 'facts' param was required (as defined in apipie). This fix removes that requirement.

Comment 10 jaudet 2015-05-22 20:54:25 UTC
Tested against a Satellite 6.1.0 system running on RHEL 7.1.

    >>> from nailgun.entities import System
    >>> from nailgun import client
    >>> from nailgun.config import ServerConfig
    >>> cfg = ServerConfig.get()
    >>> path = System(cfg, id='8485c939-5c4d-4172-8131-e9e375e1c21b').path()
    >>> print(path)
    https://…/katello/api/v2/systems/8485c939-5c4d-4172-8131-e9e375e1c21b
    >>> response = client.put(path, **cfg.get_client_kwargs())
    WARNING:nailgun.client:Received HTTP 400 response: {"displayMessage":"Missing values for system.","errors":["key not found: system"]}
    >>> response = client.put(path, {}, **cfg.get_client_kwargs())
    WARNING:nailgun.client:Received HTTP 400 response: {"displayMessage":"Missing values for system.","errors":["key not found: system"]}
    >>> response = client.put(path, {'facts': {}}, **cfg.get_client_kwargs())
    >>> response.status_code
    200

Comment 11 jaudet 2015-05-22 21:03:50 UTC
Created attachment 1028937 [details]
Output of foreman-debug from the Satellite 6.1 RHEL 7.1 system used for testing.

Comment 12 Tom McKay 2015-05-29 15:46:59 UTC
I do not believe that error has to do with my changes, does it? I simply didn't require the facts params. Having to pass nested system params is an entirely different issue.

Comment 13 jaudet 2015-06-15 18:49:24 UTC
#c0 states that the JSON payload should not require a "facts" key when issuing a PUT request. I tested a server and discovered that:

* A PUT request fails when I do not provide "facts" in the JSON payload.
* A PUT request succeeds when I do provide "facts" in the JSON payload.

There in no other difference between the second and third request. Therefore, I conclude that the server still does require a "facts" key when issuing a PUT request and that the bug has not been fixed. The error message which mentions a "system" key is a totally different issue.

Comment 14 Tom McKay 2016-02-26 14:12:17 UTC
New API upstream (/systems changed to /hosts)


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