Bug #14708
closedhammer fails to remove LCE from a CV if cv_id+org_id or cv_name+org_name are specified
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1325113
Description of problem:
Hammer fails to delete a lifecycle environment from content view if content view was specified by both CV id and organization id. Specifying cv id + org id is not mandatory, as cv id is unique and it should be sufficient for determining desired cv, but anyway exception shouldn't be risen when user also includes org id.
Other use cases like specifying only cv id or cv name + org id are working as expected.
Version-Release number of selected component (if applicable):
Sat6.2 Beta Snap6.2
How reproducible:
Always
Steps to Reproduce:
1. Create a content view:
hammer content-view create --organization-id="15" --name="VQnMGNiFIN"
2. Publish it:
hammer content-view publish --id="22"
3. Try to remove default Library lifecycle environment while specifying both content view id and organization id:
hammer content-view remove --id="22" --organization-id="15" --environment-ids="26"
Actual results:
[ERROR 2016-04-08 05:14:20 Exception] Error: undefined method `include?' for nil:NilClass
Could not remove objects from content view:
Error: undefined method `include?' for nil:NilClass
[ERROR 2016-04-08 05:14:20 Exception]
NoMethodError (undefined method `include?' for nil:NilClass):
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.0.22.5/lib/hammer_cli_katello/id_resolver.rb:65:in `block in environment_ids'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.0.22.5/lib/hammer_cli_katello/id_resolver.rb:65:in `select'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.0.22.5/lib/hammer_cli_katello/id_resolver.rb:65:in `environment_ids'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.3/lib/hammer_cli_foreman/commands.rb:165:in `get_resource_ids'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.3/lib/hammer_cli_foreman/commands.rb:231:in `block in customized_options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.3/lib/hammer_cli_foreman/commands.rb:228:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.3/lib/hammer_cli_foreman/commands.rb:228:in `customized_options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.3/lib/hammer_cli_foreman/commands.rb:243:in `request_params'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.0.22.5/lib/hammer_cli_katello/content_view.rb:183:in `request_params'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.4/lib/hammer_cli/apipie/command.rb:43:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.3/lib/hammer_cli_foreman/commands.rb:189:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_tasks-0.0.10/lib/hammer_cli_foreman_tasks/async_command.rb:14: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.4/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.4/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.4/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.4/bin/hammer:125:in `<top (required)>'
/usr/bin/hammer:23:in `load'
/usr/bin/hammer:23:in `<main>'
Expected results:
Lifecycle environment was removed successfully
Additional info: