Description of problem: I was trying to create a subnet via hammer and used all possible options including --organization-ids. # hammer -u admin -p changeme subnet create --name "subnet119" --dhcp-id=1 --dns-id=1 --dns-primary 10.0.0.1 --gateway 10.0.0.126 --mask 255.255.255.128 --tftp-id=1 --domain-ids=1 --location-ids=1 --organization-ids=1 --network=10.0.0.0 Could not create the subnet: resource have no errors debug logs: [DEBUG 2016-05-17 08:21:26 API] 500 Internal Server Error { "error" => { "message" => "resource have no errors" } } [ERROR 2016-05-17 08:21:26 Exception] resource have no errors Could not create the subnet: resource have no errors [ERROR 2016-05-17 08:21:26 Exception] RestClient::InternalServerError (500 Internal Server Error): /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:308:in `block in rest_client_call_block' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:228:in `call' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:228:in `process_result' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit' /opt/rh/rh-ruby22/root/usr/share/ruby/net/http.rb:853:in `start' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:67:in `post' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:295:in `call_client' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:224:in `http_call' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:174:in `call_action' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:169:in `call' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/resource.rb:14:in `call' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.6/lib/hammer_cli/apipie/command.rb:43:in `send_request' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.6/lib/hammer_cli_foreman/commands.rb:190:in `send_request' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.6/lib/hammer_cli/apipie/command.rb:34:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.6/lib/hammer_cli/abstract.rb:22:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.6/lib/hammer_cli/abstract.rb:22:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.6/lib/hammer_cli/abstract.rb:22:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.6/bin/hammer:125:in `<top (required)>' /usr/bin/hammer:23:in `load' /usr/bin/hammer:23:in `<main>' Version-Release number of selected component (if applicable): Sat6.2 snap11.0 How reproducible: Steps to Reproduce: 1. create subnet with --organization-ids 2. 3. Actual results: Could not create the subnet: resource have no errors Expected results: subnet should be created Additional info:
# hammer -u admin -p changeme subnet create --name "subnet119" --dhcp-id=1 --dns-id=1 --dns-primary 10.0.0.1 --gateway 10.0.0.126 --mask 255.255.255.128 --tftp-id=1 --domain-ids=1 --location-ids=1 --organization-ids=1 --network=10.0.0.0 Could not create the subnet: resource have no errors ]# hammer -u admin -p changeme organization list ---|----------------------|----------------------|------------ ID | NAME | LABEL | DESCRIPTION ---|----------------------|----------------------|------------ 1 | Default Organization | Default_Organization | ---|----------------------|----------------------|------------ Please note we are passing correct org id. Now, lets create subnet without associating subnet: [root@cloud-qe-15 hammerify]# hammer -u admin -p changeme subnet create --name "subnet119" --dhcp-id=1 --dns-id=1 --dns-primary 10.0.0.1 --gateway 10.0.0.126 --mask 255.255.255.128 --tftp-id=1 --domain-ids=1 --location-ids=1 --network=10.0.0.0 Subnet created
Further investigated and found that either we can specify --organization-ids or --locations-ids but not both.. see how I created subnet with using --locations-ids but with --organization-ids ]# hammer -u admin -p changeme subnet create --name "subnet120" --dhcp-id=1 --dns-id=1 --dns-primary 10.0.0.1 --gateway 10.0.0.126 --mask 255.255.255.128 --tftp-id=1 --domain-ids=1 --organization-ids=1 --network=10.0.0.0 Subnet created
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the forseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.