Description of problem: I am trying to get information about user default location and organization, but cannot find to do that. It is not a problem to set that information, but not get Version-Release number of selected component (if applicable): Satellite 6.1.0 Beta How reproducible: Always Steps to Reproduce: 1. To set location: hammer user create --login "a1" --auth-source-id "1" --password "a1" --mail "a1" --location-ids 1 --default-location-id 1 2. To get: hammer user info --login "a1" 3. There are no information about "Default Location" in the output Actual results: Id: 15 Login: a1 Name: Email: a1 Admin: no Authorized by: Internal Last login: Roles: Anonymous User groups: Locations: uYuvGkIyDrQuy Created at: 2015/04/20 13:48:12 Updated at: 2015/04/20 13:48:12 Expected results: Id: 15 Login: a1 Name: Email: a1 Admin: no Authorized by: Internal Last login: Roles: Anonymous User groups: Locations: uYuvGkIyDrQuy Default Location: uYuvGkIyDrQuy Created at: 2015/04/20 13:48:12 Updated at: 2015/04/20 13:48:12 Additional info:
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
+All steps above for default organization
Created redmine issue http://projects.theforeman.org/issues/10251 from this bug
Moving to POST since upstream bug http://projects.theforeman.org/issues/10251 has been closed ------------- Anonymous Applied in changeset commit:hammer-cli-foreman|8fd2bb5cb0336b3fdeb9759af7a09127cc550cab.
commit a41a55455efc401aed28a07015490da4658f506b Author: Tomas Strachota <tstrachota> Date: Thu Apr 23 12:52:59 2015 +0000 Fixes #10251 - adding default org and loc to user info (cherry picked from commit 8fd2bb5cb0336b3fdeb9759af7a09127cc550cab)
Failed on: It fails for location: # hammer user create --login "a1" --auth-source-id "1" --password "a1" --mail "a1" --location-ids 1 --default-location-id 1 User created # hammer user info --login "a1" Id: 4 Login: a1 Name: Email: a1 Admin: no Authorized by: Internal Last login: Default organization: Default location: Roles: Anonymous User groups: Organizations: Default Organization Created at: 2015/04/30 16:41:46 Updated at: 2015/04/30 16:41:46 But not for organization: # hammer user create --login "a2" --auth-source-id "1" --password "a2" --mail "a2" --organization-ids 1 --default-organization-id 1 User created # hammer user info --login "a2" Id: 5 Login: a2 Name: Email: a2 Admin: no Authorized by: Internal Last login: Default organization: Default Organization Default location: Roles: Anonymous User groups: Organizations: Default Organization Created at: 2015/04/30 16:44:37 Updated at: 2015/04/30 16:44:37 It also fails when setting both default location and default organization: # hammer user create --login "a3" --auth-source-id "1" --password "a3" --mail "a3" --organization-ids 1 --default-organization-id 1 --location-ids 1 --default-organization-id 1 Could not create the user: resource have no errors Follow the output in debug and verbose mode: # hammer -v -d user create --login "a3" --auth-source-id "1" --password "a3" --mail "a3" --location-ids 1 --default-location-id 1 [ INFO 2015-04-30 12:51:14 Init] Initialization of Hammer CLI (0.1.4.9) has started... [DEBUG 2015-04-30 12:51:14 Init] Running at ruby 2.0.0-p598 [ INFO 2015-04-30 12:51:14 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded [ INFO 2015-04-30 12:51:14 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded [ INFO 2015-04-30 12:51:14 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded [ INFO 2015-04-30 12:51:14 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded [ INFO 2015-04-30 12:51:14 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded [ INFO 2015-04-30 12:51:14 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded [ INFO 2015-04-30 12:51:14 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded [DEBUG 2015-04-30 12:51:14 Connection] Registered: foreman [DEBUG 2015-04-30 12:51:14 API] Global headers: { :content_type => "application/json", :accept => "application/json;version=2", "Accept-Language" => "en" } [ INFO 2015-04-30 12:51:14 Modules] Extension module hammer_cli_foreman (0.1.4.10) loaded [ INFO 2015-04-30 12:51:14 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.2.6) loaded [ INFO 2015-04-30 12:51:14 Modules] Extension module hammer_cli_foreman_discovery (0.0.1.8) loaded [ INFO 2015-04-30 12:51:14 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed. [ INFO 2015-04-30 12:51:14 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created. [ INFO 2015-04-30 12:51:14 Modules] Extension module hammer_cli_import (0.10.6.5) loaded [ INFO 2015-04-30 12:51:14 Modules] Extension module hammer_cli_katello (0.0.7.9) loaded [DEBUG 2015-04-30 12:51:14 Init] Using locale 'en' [DEBUG 2015-04-30 12:51:14 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/share/gems/gems/hammer_cli-0.1.4.9/locale' [DEBUG 2015-04-30 12:51:14 Init] 'mo' files for locale domain 'hammer-cli@system' loaded from '/usr/share/locale' [DEBUG 2015-04-30 12:51:14 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/share/gems/gems/hammer_cli_foreman-0.1.4.10/locale' [DEBUG 2015-04-30 12:51:14 Init] 'mo' files for locale domain 'hammer-cli-foreman@system' loaded from '/usr/share/locale' [DEBUG 2015-04-30 12:51:14 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/share/gems/gems/hammer_cli_katello-0.0.7.9/locale' [ INFO 2015-04-30 12:51:14 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true} [ INFO 2015-04-30 12:51:14 HammerCLIForeman::User] Called with options: {} [ INFO 2015-04-30 12:51:14 HammerCLIForeman::User::CreateCommand] Called with options: {"option_login"=>"a3", "option_mail"=>"a3", "option_password"=>"***", "option_default_location_id"=>"1", "option_auth_source_id"=>"1", "option_location_ids"=>["1"]} [ INFO 2015-04-30 12:51:14 API] POST /api/users [DEBUG 2015-04-30 12:51:14 API] Params: { "user" => { "login" => "a3", "mail" => "a3", "password" => "a3", "default_location_id" => "1", "auth_source_id" => "1", "location_ids" => [ [0] "1" ] } } [DEBUG 2015-04-30 12:51:14 API] Headers: {} [Foreman] Username: admin [Foreman] Password for admin: [DEBUG 2015-04-30 12:51:31 API] Response: { "id" => 10, "login" => "a3", "firstname" => nil, "lastname" => nil, "mail" => "a3", "admin" => false, "auth_source_id" => 1, "auth_source_name" => "Internal", "last_login_on" => nil, "created_at" => "2015-04-30T16:51:30Z", "updated_at" => "2015-04-30T16:51:30Z", "default_location" => nil, "locations" => [ [0] { "id" => 1, "name" => "Default Organization", "title" => "Default Organization" } ], "default_organization" => nil, "organizations" => [ [0] { "id" => 1, "name" => "Default Organization", "title" => "Default Organization" } ], "auth_source_internal" => { "id" => 1, "type" => "AuthSourceInternal", "name" => "Internal" }, "mail_notifications" => [], "roles" => [ [0] { "name" => "Anonymous", "id" => 14 } ], "usergroups" => [] } [DEBUG 2015-04-30 12:51:31 API] Response headers: { :date => "Thu, 30 Apr 2015 16:51:30 GMT", :server => "Apache/2.4.6 (Red Hat Enterprise Linux)", :foreman_version => "1.7.2", :foreman_api_version => "2", :apipie_checksum => "85179ec311129f67b4c37efdfb780a69", :x_ua_compatible => "IE=Edge,chrome=1", :cache_control => "max-age=0, private, must-revalidate", :x_request_id => "ecf1c6e08e688253f1e77d389cf5d8aa", :x_runtime => "0.592974", :x_rack_cache => "invalidate, pass", :x_powered_by => "Phusion Passenger 4.0.18", :set_cookie => [ [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTNiZWE5NDQ3OGI1YWMxMDVlMWUyMzExMTQwZDIzMzg5BjsAVEkiC2xvY2FsZQY7AEYiB2Vu--8fe7425fa061e24e34f9c92d4163c59760146c0a; path=/; HttpOnly" ], :etag => "\"436a6852cf5fd56bfe4fd5ad36b36767\"", :status => "200 OK", :connection => "close", :transfer_encoding => "chunked", :content_type => "application/json; charset=utf-8" } User created # hammer -v -d user create --login "a3" --auth-source-id "1" --password "a3" --mail "a3" --organization-ids 1 --default-organization-id 1 --location-ids 1 --default-organization-id 1 [ INFO 2015-04-30 12:49:17 Init] Initialization of Hammer CLI (0.1.4.9) has started... [DEBUG 2015-04-30 12:49:17 Init] Running at ruby 2.0.0-p598 [ INFO 2015-04-30 12:49:17 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded [ INFO 2015-04-30 12:49:17 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded [ INFO 2015-04-30 12:49:17 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded [ INFO 2015-04-30 12:49:17 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded [ INFO 2015-04-30 12:49:17 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded [ INFO 2015-04-30 12:49:17 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded [ INFO 2015-04-30 12:49:17 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded [DEBUG 2015-04-30 12:49:18 Connection] Registered: foreman [DEBUG 2015-04-30 12:49:18 API] Global headers: { :content_type => "application/json", :accept => "application/json;version=2", "Accept-Language" => "en" } [ INFO 2015-04-30 12:49:18 Modules] Extension module hammer_cli_foreman (0.1.4.10) loaded [ INFO 2015-04-30 12:49:18 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.2.6) loaded [ INFO 2015-04-30 12:49:18 Modules] Extension module hammer_cli_foreman_discovery (0.0.1.8) loaded [ INFO 2015-04-30 12:49:18 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed. [ INFO 2015-04-30 12:49:18 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created. [ INFO 2015-04-30 12:49:18 Modules] Extension module hammer_cli_import (0.10.6.5) loaded [ INFO 2015-04-30 12:49:18 Modules] Extension module hammer_cli_katello (0.0.7.9) loaded [DEBUG 2015-04-30 12:49:18 Init] Using locale 'en' [DEBUG 2015-04-30 12:49:18 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/share/gems/gems/hammer_cli-0.1.4.9/locale' [DEBUG 2015-04-30 12:49:18 Init] 'mo' files for locale domain 'hammer-cli@system' loaded from '/usr/share/locale' [DEBUG 2015-04-30 12:49:18 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/share/gems/gems/hammer_cli_foreman-0.1.4.10/locale' [DEBUG 2015-04-30 12:49:18 Init] 'mo' files for locale domain 'hammer-cli-foreman@system' loaded from '/usr/share/locale' [DEBUG 2015-04-30 12:49:18 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/share/gems/gems/hammer_cli_katello-0.0.7.9/locale' [ INFO 2015-04-30 12:49:18 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true} [ INFO 2015-04-30 12:49:18 HammerCLIForeman::User] Called with options: {} [ INFO 2015-04-30 12:49:18 HammerCLIForeman::User::CreateCommand] Called with options: {"option_login"=>"a3", "option_mail"=>"a3", "option_password"=>"***", "option_default_organization_id"=>"1", "option_auth_source_id"=>"1", "option_location_ids"=>["1"], "option_organization_ids"=>["1"]} [ INFO 2015-04-30 12:49:18 API] POST /api/users [DEBUG 2015-04-30 12:49:18 API] Params: { "user" => { "login" => "a3", "mail" => "a3", "password" => "a3", "default_organization_id" => "1", "auth_source_id" => "1", "location_ids" => [ [0] "1" ], "organization_ids" => [ [0] "1" ] } } [DEBUG 2015-04-30 12:49:18 API] Headers: {} [Foreman] Username: admin [Foreman] Password for admin: [DEBUG 2015-04-30 12:49:35 API] 500 Internal Server Error { "error" => { "message" => "resource have no errors" } } [ERROR 2015-04-30 12:49:35 Exception] resource have no errors Could not create the user: resource have no errors [ERROR 2015-04-30 12:49:35 Exception] RestClient::InternalServerError (500 Internal Server Error): /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit' /usr/share/ruby/net/http.rb:852:in `start' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:67:in `post' /usr/share/gems/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:279:in `call_client' /usr/share/gems/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:210:in `http_call' /usr/share/gems/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:160:in `call' /usr/share/gems/gems/apipie-bindings-0.0.11/lib/apipie_bindings/resource.rb:14:in `call' /usr/share/gems/gems/hammer_cli-0.1.4.9/lib/hammer_cli/apipie/command.rb:43:in `send_request' /usr/share/gems/gems/hammer_cli_foreman-0.1.4.10/lib/hammer_cli_foreman/commands.rb:185:in `send_request' /usr/share/gems/gems/hammer_cli-0.1.4.9/lib/hammer_cli/apipie/command.rb:34:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.4.9/lib/hammer_cli/abstract.rb:23:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.4.9/lib/hammer_cli/abstract.rb:23:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.4.9/lib/hammer_cli/abstract.rb:23:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run' /usr/share/gems/gems/hammer_cli-0.1.4.9/bin/hammer:108:in `<top (required)>' /usr/bin/hammer:23:in `load' /usr/bin/hammer:23:in `<main>'
Missed the build information on last comment. Failed on: Satellite-6.1.0-RHEL-7-20150429.2
Hello Elyézer, I noticed that you used the same id for default location and organization in your reproducer steps. It is not possible if you run both commands against one satellite machine. Can you please re-verify and make sure you use correct ids, please? I suspect that what you observe is: https://bugzilla.redhat.com/show_bug.cgi?id=1218932
Tomas good observation. I have retested this and now this bug can be verified. Verified on: Satellite-6.1.0-RHEL-7-20150506.0 Steps to verify: 1) hammer> user create --login "a1" --auth-source-id "1" --password "a1" --mail "a1" --location-ids 2 --default-location-id 2 --organization-ids 1 --default-organization-id 1 User created 2) hammer> user info --login "a1" Id: 130 Login: a1 Name: Email: a1 Admin: no Authorized by: Internal Last login: Default organization: Default Organization Default location: Default Location Roles: Anonymous User groups: Locations: Default Location Organizations: Default Organization Created at: 2015/05/11 15:23:15 Updated at: 2015/05/11 15:23:15
This bug is slated to be released with Satellite 6.1.
This bug was fixed in version 6.1.1 of Satellite which was released on 12 August, 2015.