Actions
Bug #23918
closedUnable to associate organization with location (regression 1.18)
Difficulty:
Triaged:
No
Bugzilla link:
Description
Hey folks, 1.18 RC1 here, this was working previously in 1.16 and perhaps 1.17:
[root@foreman ~]# hammer location list ---|-------|-------|------------ ID | TITLE | NAME | DESCRIPTION ---|-------|-------|------------ 2 | MyLoc | MyLoc | ---|-------|-------|------------ [root@foreman ~]# hammer organization list ---|-------|-------|------------ ID | TITLE | NAME | DESCRIPTION ---|-------|-------|------------ 1 | MyOrg | MyOrg | ---|-------|-------|------------ [root@foreman ~]# hammer location add-organization --name MyLoc --organization MyOrg Could not associate the organization: Resource location not found by id '2'
What I want to do is to associate Org with Loc.
Updated by Tomáš Strachota over 6 years ago
It needs further investigation but it seems to be an API problem.
Hammer correctly finds the location by name and sends the id in url:
[ INFO 2018-06-14T10:22:47 API] Server: https://centos7-devel.example.com/ [ INFO 2018-06-14T10:22:47 API] PUT /api/locations/6 [DEBUG 2018-06-14T10:22:47 API] Params: { "organization_id" => 3, "location" => { "organization_ids" => [ [0] "3" ] } } [DEBUG 2018-06-14T10:22:47 API] Headers: {} [DEBUG 2018-06-14T10:22:47 API] Using authenticator: HammerCLIForeman::Api::SessionAuthenticatorWrapper [ERROR 2018-06-14T10:22:47 API] 404 Not Found [DEBUG 2018-06-14T10:22:47 API] { "error" => { "message" => "Resource location not found by id '6'" } } [DEBUG 2018-06-14T10:22:47 Exception] Using exception handler HammerCLIForeman::ExceptionHandler#handle_not_found [ERROR 2018-06-14T10:22:47 Exception] Resource location not found by id '6' Could not associate the organization: Resource location not found by id '6'
But on server side the resource is not found, because the resource_scope is []. It might be related to recent changes in taxonomy scoping.
hammer location info --id 6 works normally.
Updated by Ondřej Pražák over 6 years ago
- Assignee set to Ondřej Pražák
- Triaged set to No
Updated by Ondřej Pražák over 6 years ago
- Project changed from Hammer CLI to Foreman
- Category deleted (
Organizations and locations)
Updated by The Foreman Bot over 6 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/5768 added
Updated by Ondřej Pražák over 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 3ab566045498d9e333ee8e3172b881231df4c842.
Updated by The Foreman Bot over 6 years ago
- Pull request https://github.com/theforeman/foreman/pull/5812 added
Updated by The Foreman Bot over 6 years ago
- Pull request https://github.com/theforeman/foreman/pull/5816 added
Actions