Project

General

Profile

Actions

Bug #26057

closed

Cannot create hostgroup with --environment

Added by Ondřej Pražák about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
-
Difficulty:
Triaged:
Yes
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Found in nightly, hammer_cli_foreman 0.17.pre.develop

Steps to reproduce:
1) make sure both organization and location exists and environment is assigned to them
2) hammer hostgroup create --name 'base' --environment production --organizations 'Default Organization' --locations 'Default Location'
3) no call is made to API and command fails with misleading message about mission org/loc options

[root@foreman ~]# hammer -d  hostgroup create --name 'Base4' --environment production --organizations 'Default Organization' --locations 'Default Location'
[ INFO 2019-02-15T06:10:34 Init] Initialization of Hammer CLI (0.17.pre.develop) has started...
[DEBUG 2019-02-15T06:10:34 Init] Running at ruby 2.5.3-p105
[ INFO 2019-02-15T06:10:34 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2019-02-15T06:10:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2019-02-15T06:10:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2019-02-15T06:10:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2019-02-15T06:10:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2019-02-15T06:10:34 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[ INFO 2019-02-15T06:10:34 Init] Configuration from the file /root/.hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2019-02-15T06:10:34 Init] Configuration from the file /root/.hammer/cli.modules.d/zzz_foreman_forklift_credentials.yml has been loaded
[DEBUG 2019-02-15T06:10:34 SSLoptions] SSL options: {
    :ssl_ca_file => "/etc/pki/katello/certs/katello-server-ca.crt",
     :verify_ssl => true
}
[DEBUG 2019-02-15T06:10:34 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en" 
}
[DEBUG 2019-02-15T06:10:34 API] Follow redirects: never
[DEBUG 2019-02-15T06:10:34 Connection] Registered: foreman
[ INFO 2019-02-15T06:10:34 Modules] Extension module hammer_cli_foreman (0.17.pre.develop) loaded.
[ INFO 2019-02-15T06:10:34 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3) loaded.
[ INFO 2019-02-15T06:10:34 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2019-02-15T06:10:34 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2019-02-15T06:10:35 Modules] Extension module hammer_cli_katello (0.18.pre.master) loaded.
[DEBUG 2019-02-15T06:10:35 Init] Using locale 'en'
[DEBUG 2019-02-15T06:10:35 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/locale'
[DEBUG 2019-02-15T06:10:35 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.17.pre.develop/locale'
[DEBUG 2019-02-15T06:10:35 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.4/locale'
[DEBUG 2019-02-15T06:10:35 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.18.pre.master/locale'
[ INFO 2019-02-15T06:10:35 HammerCLI::MainCommand] Called with options: {"option_debug"=>true}
[ INFO 2019-02-15T06:10:35 HammerCLIForeman::Hostgroup] Called with options: {}
[ INFO 2019-02-15T06:10:35 HammerCLIForeman::Hostgroup::CreateCommand] Error occured while searching for environment
[DEBUG 2019-02-15T06:10:35 Exception] Using exception handler HammerCLIForeman::ExceptionHandler#handle_general_exception
[ERROR 2019-02-15T06:10:35 Exception] Error: Could not find organization, please set one of options --organization, --organization-title, --organization-id, --organizations, --organization-titles, --organization-ids.
Could not create the hostgroup:
  Error: Could not find organization, please set one of options --organization, --organization-title, --organization-id, --organizations, --organization-titles, --organization-ids.
[ERROR 2019-02-15T06:10:35 Exception] 

HammerCLIForeman::MissingSearchOptions (Could not find organization, please set one of options --organization, --organization-title, --organization-id, --organizations, --organization-titles, --organization-ids.):
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.17.pre.develop/lib/hammer_cli_foreman/option_sources/id_params.rb:41:in `rescue in get_options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.17.pre.develop/lib/hammer_cli_foreman/option_sources/id_params.rb:16:in `get_options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/options/sources/base.rb:8:in `process'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/options/processor_list.rb:22:in `block in process'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/options/processor_list.rb:21:in `each'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/options/processor_list.rb:21:in `inject'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/options/processor_list.rb:21:in `process'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/options/processor_list.rb:22:in `block in process'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/options/processor_list.rb:21:in `each'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/options/processor_list.rb:21:in `inject'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/options/processor_list.rb:21:in `process'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/options/option_collector.rb:17:in `all_options_raw'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/options/option_collector.rb:21:in `all_options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/options/option_collector.rb:25:in `options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/abstract.rb:259:in `options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/abstract.rb:49:in `parse'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:62:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.17.pre.develop/lib/hammer_cli/abstract.rb:36:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11: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-0.17.pre.develop/lib/hammer_cli/abstract.rb:36:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11: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-0.17.pre.develop/lib/hammer_cli/abstract.rb:36: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-0.17.pre.develop/bin/hammer:147:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'

Related issues 1 (0 open1 closed)

Related to Hammer CLI - Bug #23204: inconsitent puppet environment naming in hammerClosedOleh FedorenkoActions
Actions #1

Updated by Oleh Fedorenko about 5 years ago

  • Status changed from New to Assigned
  • Assignee set to Oleh Fedorenko
Actions #2

Updated by Oleh Fedorenko about 5 years ago

  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/401 added
Actions #3

Updated by Oleh Fedorenko about 5 years ago

  • Related to Bug #23204: inconsitent puppet environment naming in hammer added
Actions #4

Updated by Oleh Fedorenko about 5 years ago

  • Status changed from Assigned to Ready For Testing
Actions #5

Updated by Oleh Fedorenko almost 5 years ago

  • Status changed from Ready For Testing to Closed
  • Triaged changed from No to Yes
Actions

Also available in: Atom PDF