Project

General

Profile

Actions

Bug #33729

closed

Some hammer-cli-katello commands fail when Puppet is disabled

Added by Eric Helms over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

When Puppet is disabled at install time, and hammer is ran, there are errors from some commands as seen from these bats tests examples:

    not ok 15 create content view
    # (in test file fb-katello-content.bats, line 99)
    #   `--name="${CONTENT_VIEW}" | grep -q "Content view created"' failed
    # Error: undefined method `singular_name' for nil:NilClass
    not ok 16 add yum repo to content view
    # (in test file fb-katello-content.bats, line 106)
    #   `--name="${CONTENT_VIEW}" --repository-id=$repo_id | grep -q "The repository has been associated"' failed
    # Error: undefined method `singular_name' for nil:NilClass
    not ok 17 publish content view
    # (in test file fb-katello-content.bats, line 110)
    #   `hammer content-view publish --organization="${ORGANIZATION}" \' failed with status 70
    # Error: undefined method `singular_name' for nil:NilClass
    not ok 18 promote content view
    # (in test file fb-katello-content.bats, line 115)
    #   `hammer content-view version promote  --organization="${ORGANIZATION}" \' failed with status 70
    # Error: undefined method `singular_name' for nil:NilClass

The error output is:

    #<Proc:0x000000000251ae58 /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-1.1.1.pre.master/lib/hammer_cli_katello/command_extensions/lifecycle_environment.rb:8>
[ INFO 2021-10-19T01:22:18 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for *all* except *nothing* on HammerCLIKatello::ContentViewVersion::ListCommand.

<Resource :content_views>
<Resource :organizations>
[DEBUG 2021-10-19T01:22:18 Exception] Using exception handler HammerCLI::ExceptionHandler#handle_general_exception
[ERROR 2021-10-19T01:22:18 Exception] Error: undefined method `singular_name' for nil:NilClass
Error: undefined method `singular_name' for nil:NilClass
[ERROR 2021-10-19T01:22:18 Exception] 

NoMethodError (undefined method `singular_name' for nil:NilClass):
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-1.1.1.pre.master/lib/hammer_cli_katello/id_resolver.rb:39:in `for'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-3.1.0.pre.develop/lib/hammer_cli_foreman/option_builders.rb:224:in `dependent_options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-3.1.0.pre.develop/lib/hammer_cli_foreman/option_builders.rb:217:in `build'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-3.1.0.pre.develop/lib/hammer_cli/option_builder.rb:27:in `block in build'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-3.1.0.pre.develop/lib/hammer_cli/option_builder.rb:26:in `each'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-3.1.0.pre.develop/lib/hammer_cli/option_builder.rb:26:in `build'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-3.1.0.pre.develop/lib/hammer_cli_foreman/option_builders.rb:129:in `build'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-3.1.0.pre.develop/lib/hammer_cli/abstract.rb:237:in `build_options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-3.1.0.pre.develop/lib/hammer_cli_foreman/commands.rb:125:in `build_options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-1.1.1.pre.master/lib/hammer_cli_katello/content_view_version.rb:62:in `<class:InfoCommand>'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-1.1.1.pre.master/lib/hammer_cli_katello/content_view_version.rb:32:in `<class:ContentViewVersion>'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-1.1.1.pre.master/lib/hammer_cli_katello/content_view_version.rb:4:in `<module:HammerCLIKatello>'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-1.1.1.pre.master/lib/hammer_cli_katello/content_view_version.rb:3:in `<top (required)>'
    /opt/rh/rh-ruby27/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
    /opt/rh/rh-ruby27/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-1.1.1.pre.master/lib/hammer_cli_katello/content_view.rb:3:in `<top (required)>'
    /opt/rh/rh-ruby27/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
    /opt/rh/rh-ruby27/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-3.1.0.pre.develop/lib/hammer_cli/subcommand.rb:48:in `subcommand_class'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:33:in `find_subcommand_class'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:17:in `instantiate_subcommand'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:10:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-3.1.0.pre.develop/lib/hammer_cli/abstract.rb:103:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-3.1.0.pre.develop/bin/hammer:147:in `<top (required)>'
    /bin/hammer:23:in `load'
    /bin/hammer:23:in `<main>'
Actions #1

Updated by Ryan Verdile over 2 years ago

  • Target version set to Katello 4.3.0
  • Triaged changed from No to Yes
Actions #2

Updated by Chris Roberts over 2 years ago

  • Pull request https://github.com/Katello/hammer-cli-katello/pull/818 added
Actions #3

Updated by Chris Roberts over 2 years ago

  • Category set to Hammer
  • Status changed from New to Ready For Testing
  • Assignee set to Oleh Fedorenko
Actions #4

Updated by Eric Helms over 2 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF