Actions
Bug #22765
openhammer organization add-location constructs invalid payload for PUT endpoint
Status:
New
Priority:
Normal
Assignee:
-
Category:
Organizations and Locations
Target version:
-
Description
# hammer -d -u admin -p changeme organization add-location --location-id 2 --id 1 ... [ INFO 2018-03-05T07:14:14 API] PUT /katello/api/organizations/1 [DEBUG 2018-03-05T07:14:14 API] Params: { "location_id" => 2, "organization" => { "location_ids" => [ [0] "2" ] } } [DEBUG 2018-03-05T07:14:14 API] Headers: {} [DEBUG 2018-03-05T07:14:14 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth [ERROR 2018-03-05T07:14:14 API] 404 Not Found [DEBUG 2018-03-05T07:14:14 API] { "error" => { "message" => "Resource organization not found by id '1'" } }
there shouldn't be any "location_id" parameter put outside of the "organization" hash. Excluding this parameter from the payload makes the PUT request successful
Updated by Oleh Fedorenko about 6 years ago
Is it still reproducible (in Nightly)? I tried it now and it still builds the same payload, but works.
# hammer organization add-location --location-id 5 --id 4 ... [ INFO 2019-04-02T17:01:52 API] PUT /katello/api/organizations/4 [DEBUG 2019-04-02T17:01:52 API] Params: { "location_id" => 5, "organization" => { "location_ids" => [ [0] "5" ] } } ... The location has been associated.
Actions