Description of problem: When updating an activation key passing its ID, the organization option should not be required. Version-Release number of selected component (if applicable): # hammer --version hammer (0.1.1) * hammer_cli_foreman (0.1.1) * hammer_cli_katello (0.0.4) How reproducible: Aways Steps to Reproduce: 1. Create an activation key using hammer 2. Try to update its name passing --id and --new-name options Actual results: The activation key is not updated and an exception is raised Expected results: The activation key should be updated. Additional info: # LANG=en_US hammer -v -u admin -p changeme --output csv activation-key create --name='ue99k5' --organization-id='169' --usage-limit='unlimited' Message,Id,Name Activation key created,35,ue99k5 # LANG=en_US hammer -v -u admin -p changeme activation-key info --id='35' Name: ue99k5 ID: 35 Description: Lifecycle Environment: Content View: Host Collections: # LANG=en_US hammer -v -u admin -p changeme --output csv activation-key update --id='35' --new-name='glHZmTDUdzxiYFJ' [ERROR 2014-06-27 14:02:31 Exception] Error: Missing options to search organization Could not update the activation key: Error: Missing options to search organization [ERROR 2014-06-27 14:02:31 Exception] HammerCLIForeman::MissingSeachOptions (Missing options to search organization): /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/id_resolver.rb:115:in `search_options' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/id_resolver.rb:88:in `find_resource' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/id_resolver.rb:82:in `get_id' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/id_resolver.rb:76:in `organization_id' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:133:in `send' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:133:in `get_resource_id' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:164:in `request_params' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:161:in `each' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:161:in `request_params' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in `send_request' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:154:in `send_request' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in `execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100 /usr/bin/hammer:19:in `load' /usr/bin/hammer:19
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.
Created redmine issue http://projects.theforeman.org/issues/6465 from this bug
Pull-request to upstream (https://github.com/Katello/hammer-cli-katello/pull/202) was rejected. Organization should be given since activation-keys should always have an organization as context.