Bug 1573879 - api - unable to assign location to organization
Summary: api - unable to assign location to organization
Keywords:
Status: CLOSED DUPLICATE of bug 1597501
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Organizations and Locations
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Sanket Jagtap
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-02 12:26 UTC by Roman Plevka
Modified: 2019-04-01 20:26 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-06 11:17:02 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Roman Plevka 2018-05-02 12:26:20 UTC
Description of problem:

unable to assign any location to an organization using API and CLI (UI works) - the PUT request results in 404 (organization not found) despite the fact, that the organization exists and is perfectly listable by the same user:

the following is a part of debug output from the hammer command:
# hammer -d -u admin -p changeme  organization add-location --id="116" --location-id="2"
...
[ INFO 2018-05-02T08:16:53 API] GET /katello/api/organizations/116
[DEBUG 2018-05-02T08:16:53 API] Params: {}
[DEBUG 2018-05-02T08:16:53 API] Headers: {
    :params => {}
}
[DEBUG 2018-05-02T08:16:53 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[DEBUG 2018-05-02T08:16:53 API] Response: {
                      "label" => "rplevka_org",
              "owner_details" => {
                  "parentOwner" => nil,
                           "id" => "8a...ad",
...
[ INFO 2018-05-02T08:16:53 API] PUT /katello/api/organizations/116
[DEBUG 2018-05-02T08:16:53 API] Params: {
     "location_id" => 2,
    "organization" => {
        "location_ids" => [
            [0] "2"
        ]
    }
}
[DEBUG 2018-05-02T08:16:53 API] Headers: {}
[DEBUG 2018-05-02T08:16:53 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[ERROR 2018-05-02T08:16:54 API] 404 Not Found
[DEBUG 2018-05-02T08:16:54 API] {
    "error" => {
        "message" => "Resource organization not found by id '116'"
    }
}


Version-Release number of selected component (if applicable):
6.4.0-1

How reproducible:
always

Steps to Reproduce:
1. create an org and loc
2. try to assign a location to an org using `hammer organization add-location` or `hammer organization update --id 1 --location-id 2` commands


Actual results:
404, unable to find the organization by id



Additional info:

Comment 2 Daniel Lobato Garcia 2018-07-06 11:17:02 UTC
Marking as duplicate - the newer bug report is already being worked on.

*** This bug has been marked as a duplicate of bug 1597501 ***


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