Bug #14708

hammer fails to remove LCE from a CV if cv_id+org_id or cv_name+org_name are specified

Added by Zach Huntington-Meath over 3 years ago. Updated about 1 year ago.

Content Views
Target version:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:


Cloned from
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:

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- `block in environment_ids'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello- `select'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello- `environment_ids'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman- `get_resource_ids'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman- `block in customized_options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman- `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman- `customized_options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman- `request_params'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello- `request_params'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli- `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman- `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- `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- `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- `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- `<top (required)>'
/usr/bin/hammer:23:in `load'
/usr/bin/hammer:23:in `<main>'

Expected results:
Lifecycle environment was removed successfully

Additional info:


#1 Updated by Zach Huntington-Meath over 3 years ago

  • Status changed from New to Assigned
  • Assignee set to Zach Huntington-Meath

#2 Updated by The Foreman Bot over 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request added

#3 Updated by Eric Helms over 3 years ago

  • Legacy Backlogs Release (now unused) set to 143

#4 Updated by Justin Sherrill over 3 years ago

  • Legacy Backlogs Release (now unused) changed from 143 to 114
  • Pull request deleted (

#5 Updated by Andrew Kofink about 1 year ago

  • Status changed from Ready For Testing to Rejected

Also available in: Atom PDF