Bug 1573879

Summary: api - unable to assign location to organization
Product: Red Hat Satellite Reporter: Roman Plevka <rplevka>
Component: Organizations and LocationsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Sanket Jagtap <sjagtap>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: akarsale, apatel, dlobatog, jhutar, mhulan, sjagtap, tstrachota
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-06 11:17:02 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 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 ***