Project

General

Profile

Actions

Bug #24183

closed

Cannot add location to organizations via CLI

Added by Daniel Lobato Garcia about 6 years ago. Updated almost 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Organizations and locations
Target version:
-
Difficulty:
Triaged:
No
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1597501

How reproducible:
Always on CLI

Steps to Reproduce:
[root@qe-sat6-upgrade-rhel7 ~]# hammer -v -u admin -p changeme --output=csv organization create --name="c8E8qp1"
Message,Id,Name
Organization created,222,c8E8qp1
[root@qe-sat6-upgrade-rhel7 ~]# hammer -v -u admin -p changeme --output=csv location create --name="5rQAoW20JW1"
Message,Id,Name
Location created.,223,5rQAoW20JW1
[root@qe-sat6-upgrade-rhel7 ~]# hammer -v -u admin -p changeme organization add-location --id=222 --location-id=223
[ERROR 2018-07-03T01:38:44 API] 404 Not Found
[ERROR 2018-07-03T01:38:44 Exception] Resource organization not found by id '222'
Could not associate the location:
Resource organization not found by id '222'

Actual results:
[ERROR 2018-07-03T01:38:44 Exception]

RestClient::NotFound (404 Not Found):
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:223:in `exception_with_response'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:103:in `return!'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:353:in `block in rest_client_call_block'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:807:in `process_result'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:725:in `block in transmit'
/opt/rh/rh-ruby24/root/usr/share/ruby/net/http.rb:877:in `start'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:715:in `transmit'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:145:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:52:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/resource.rb:76:in `put'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:327:in `call_client'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:240:in `http_call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:190:in `call_action'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:185:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/resource.rb:21:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/apipie/command.rb:51:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.0/lib/hammer_cli_foreman/commands.rb:168:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/apipie/command.rb:34:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/abstract.rb:29:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/abstract.rb:29:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/abstract.rb:29:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/bin/hammer:143:in `<top (required)>'
/usr/bin/hammer:23:in `load'
/usr/bin/hammer:23:in `<main>'

Expected results:
Location should have been added successfully

Additional info:
Looking into debug output, it looks like api searches for the organization in the location.

Actions

Also available in: Atom PDF