Bug #30250
closedAdding subscription to activation-key fails on incorrectly detected duplicates
Description
Log:
- hammer -d activation-key add-subscription --subscription "Centos 7" --name "centos7" --organization Openlogic
[ INFO 2020-06-26T13:25:30 Init] Initialization of Hammer CLI (2.1.1) has started...
[DEBUG 2020-06-26T13:25:30 Init] Running at ruby 2.5.5-p157
[ INFO 2020-06-26T13:25:30 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2020-06-26T13:25:30 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2020-06-26T13:25:30 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2020-06-26T13:25:30 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2020-06-26T13:25:30 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2020-06-26T13:25:30 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[ INFO 2020-06-26T13:25:30 Init] Configuration from the file /root/.hammer/cli.modules.d/foreman.yml has been loaded
[DEBUG 2020-06-26T13:25:30 SSLoptions] SSL options: {
:ssl_ca_file => "/etc/pki/katello/certs/katello-server-ca.crt",
:verify_ssl => true
}
[DEBUG 2020-06-26T13:25:30 API] Global headers: {
:content_type => "application/json",
:accept => "application/json;version=2",
"Accept-Language" => "en"
}
[DEBUG 2020-06-26T13:25:30 API] Follow redirects: never
[DEBUG 2020-06-26T13:25:30 Connection] Registered: foreman
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::OptionSources] Added predefined options for HammerCLIForeman::Command:
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::OptionSources for all except nothing on HammerCLIForeman::Command.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::Fields] Added predefined options for HammerCLIForeman::ListCommand: [:fields]
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::Fields for all except nothing on HammerCLIForeman::ListCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::Fields] Added predefined options for HammerCLIForeman::InfoCommand: [:fields]
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::Fields for all except nothing on HammerCLIForeman::InfoCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::AssociatingCommands::PuppetEnvironment::AddPuppetEnvironmentCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Called option family block for HammerCLIForeman::AssociatingCommands::PuppetEnvironment::AddPuppetEnvironmentCommand:
#<Proc:0x0000000003809c58@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb:11>
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for all except nothing on HammerCLIForeman::AssociatingCommands::PuppetEnvironment::AddPuppetEnvironmentCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::AssociatingCommands::PuppetEnvironment::RemovePuppetEnvironmentCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Called option family block for HammerCLIForeman::AssociatingCommands::PuppetEnvironment::RemovePuppetEnvironmentCommand:
#<Proc:0x0000000003809c58@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb:11>
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for all except nothing on HammerCLIForeman::AssociatingCommands::PuppetEnvironment::RemovePuppetEnvironmentCommand.
[ INFO 2020-06-26T13:25:30 Modules] Extension module hammer_cli_foreman (2.1.1) loaded.
[ INFO 2020-06-26T13:25:30 Modules] Extension module hammer_cli_foreman_bootdisk (0.3.0) loaded.
[ INFO 2020-06-26T13:25:30 Modules] Extension module hammer_cli_foreman_docker (0.0.5) loaded.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::SmartProxy::ImportPuppetClassesCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Called option family block for HammerCLIForeman::SmartProxy::ImportPuppetClassesCommand:
#<Proc:0x0000000003809c58@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb:11>
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for all except nothing on HammerCLIForeman::SmartProxy::ImportPuppetClassesCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::Capsule::Content::AddLifecycleEnvironmentCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::Capsule::Content::AddLifecycleEnvironmentCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil}
[DEBUG 2020-06-26T13:25:30 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::Capsule::Content::AddLifecycleEnvironmentCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000004458d88>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil}
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for all except nothing on HammerCLIKatello::Capsule::Content::AddLifecycleEnvironmentCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::Capsule::Content::RemoveLifecycleEnvironmentCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::Capsule::Content::RemoveLifecycleEnvironmentCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil}
[DEBUG 2020-06-26T13:25:30 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::Capsule::Content::RemoveLifecycleEnvironmentCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000004458d88>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil}
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for all except nothing on HammerCLIKatello::Capsule::Content::RemoveLifecycleEnvironmentCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::Capsule::Content::SyncCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::Capsule::Content::SyncCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil}
[DEBUG 2020-06-26T13:25:30 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::Capsule::Content::SyncCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000004458d88>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil}
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for all except nothing on HammerCLIKatello::Capsule::Content::SyncCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironments] Added predefined options for HammerCLIForeman::Organization::CreateCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironments] Called option family block for HammerCLIForeman::Organization::CreateCommand:
#<Proc:0x0000000003806260@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environments.rb:11>
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironments for all except nothing on HammerCLIForeman::Organization::CreateCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironments] Added predefined options for HammerCLIForeman::Organization::UpdateCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironments] Called option family block for HammerCLIForeman::Organization::UpdateCommand:
#<Proc:0x0000000003806260@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environments.rb:11>
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironments for all except nothing on HammerCLIForeman::Organization::UpdateCommand.
[ INFO 2020-06-26T13:25:30 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2020-06-26T13:25:30 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::SmartClassParameter::ListCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Called option family block for HammerCLIForeman::SmartClassParameter::ListCommand:
#<Proc:0x0000000003809c58@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb:11>
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for all except nothing on HammerCLIForeman::SmartClassParameter::ListCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::PuppetClass::ListCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Called option family block for HammerCLIForeman::PuppetClass::ListCommand:
#<Proc:0x0000000003809c58@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb:11>
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for all except nothing on HammerCLIForeman::PuppetClass::ListCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::PuppetClass::InfoCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Called option family block for HammerCLIForeman::PuppetClass::InfoCommand:
#<Proc:0x0000000003809c58@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb:11>
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for all except nothing on HammerCLIForeman::PuppetClass::InfoCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::Host::ListCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Called option family block for HammerCLIForeman::Host::ListCommand:
#<Proc:0x0000000003809c58@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb:11>
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for all except nothing on HammerCLIForeman::Host::ListCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::Host::CreateCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Called option family block for HammerCLIForeman::Host::CreateCommand:
#<Proc:0x0000000003809c58@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb:11>
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for all except nothing on HammerCLIForeman::Host::CreateCommand.
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces] Added predefined options for HammerCLIForeman::Host::CreateCommand:
[DEBUG 2020-06-26T13:25:30 HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces] Saved block for HammerCLIForeman::Host::CreateCommand help definition:
#<Proc:0x00000000037fd6d8@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/hosts/help/interfaces.rb:6>
[ INFO 2020-06-26T13:25:30 Extensions] Applied HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces for all except nothing on HammerCLIForeman::Host::CreateCommand.
[DEBUG 2020-06-26T13:25:30 #<Class:0x00000000036ecfc8>] Added predefined options for HammerCLIForeman::Host::CreateCommand:
[DEBUG 2020-06-26T13:25:30 #<Class:0x00000000036ecfc8>] Saved block for HammerCLIForeman::Host::CreateCommand help definition:
#<Proc:0x00000000036ec9d8@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/hosts/help/compute_resources.rb:45>
[ INFO 2020-06-26T13:25:30 Extensions] Applied #<Class:0x00000000036ecfc8> for all except nothing on HammerCLIForeman::Host::CreateCommand.
[DEBUG 2020-06-26T13:25:31 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::Host::UpdateCommand:
[DEBUG 2020-06-26T13:25:31 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Called option family block for HammerCLIForeman::Host::UpdateCommand:
#<Proc:0x0000000003809c58@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb:11>
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for all except nothing on HammerCLIForeman::Host::UpdateCommand.
[DEBUG 2020-06-26T13:25:31 HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces] Added predefined options for HammerCLIForeman::Host::UpdateCommand:
[DEBUG 2020-06-26T13:25:31 HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces] Saved block for HammerCLIForeman::Host::UpdateCommand help definition:
#<Proc:0x00000000037fd6d8@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/hosts/help/interfaces.rb:6>
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces for all except nothing on HammerCLIForeman::Host::UpdateCommand.
[DEBUG 2020-06-26T13:25:31 #<Class:0x0000000004345bd0>] Added predefined options for HammerCLIForeman::Host::UpdateCommand:
[DEBUG 2020-06-26T13:25:31 #<Class:0x0000000004345bd0>] Saved block for HammerCLIForeman::Host::UpdateCommand help definition:
#<Proc:0x0000000004345a68@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/hosts/help/compute_resources.rb:45>
[ INFO 2020-06-26T13:25:31 Extensions] Applied #<Class:0x0000000004345bd0> for all except nothing on HammerCLIForeman::Host::UpdateCommand.
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::HostErrata::ListCommand:
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::HostErrata::ListCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil}
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::HostErrata::ListCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000004458d88>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil}
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for all except nothing on HammerCLIKatello::HostErrata::ListCommand.
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::HostSubscription::CreateCommand:
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::HostSubscription::CreateCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil}
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::HostSubscription::CreateCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000004458d88>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil}
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for all except nothing on HammerCLIKatello::HostSubscription::CreateCommand.
[DEBUG 2020-06-26T13:25:31 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::Hostgroup::CreateCommand:
[DEBUG 2020-06-26T13:25:31 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Called option family block for HammerCLIForeman::Hostgroup::CreateCommand:
#<Proc:0x0000000003809c58@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb:11>
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for all except nothing on HammerCLIForeman::Hostgroup::CreateCommand.
[DEBUG 2020-06-26T13:25:31 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::Hostgroup::UpdateCommand:
[DEBUG 2020-06-26T13:25:31 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Called option family block for HammerCLIForeman::Hostgroup::UpdateCommand:
#<Proc:0x0000000003809c58@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb:11>
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for all except nothing on HammerCLIForeman::Hostgroup::UpdateCommand.
[DEBUG 2020-06-26T13:25:31 HammerCLIForeman::CommandExtensions::Ping] Added predefined options for HammerCLIForeman::PingCommand::ForemanCommand:
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIForeman::CommandExtensions::Ping for all except nothing on HammerCLIForeman::PingCommand::ForemanCommand.
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::Ping] Added predefined options for HammerCLIForeman::PingCommand::ForemanCommand:
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::Ping] Called block for HammerCLIForeman::PingCommand::ForemanCommand output definition:
#<Proc:0x000000000444c768@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.22.0/lib/hammer_cli_katello/command_extensions/ping.rb:13>
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIKatello::CommandExtensions::Ping for all except nothing on HammerCLIForeman::PingCommand::ForemanCommand.
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIForeman::CommandExtensions::Ping for [:data] only on HammerCLIForeman::StatusCommand::ForemanCommand.
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIForeman::CommandExtensions::Status for [:data] only on HammerCLIForeman::StatusCommand::ForemanCommand.
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::Ping] Added predefined options for HammerCLIForeman::StatusCommand::ForemanCommand:
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::Ping] Called block for HammerCLIForeman::StatusCommand::ForemanCommand output definition:
#<Proc:0x000000000444c768@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.22.0/lib/hammer_cli_katello/command_extensions/ping.rb:13>
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIKatello::CommandExtensions::Ping for all except nothing on HammerCLIForeman::StatusCommand::ForemanCommand.
[ INFO 2020-06-26T13:25:31 Modules] Extension module hammer_cli_katello (0.22.0) loaded.
[DEBUG 2020-06-26T13:25:31 Init] Using locale 'en'
[DEBUG 2020-06-26T13:25:31 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/locale'
[DEBUG 2020-06-26T13:25:31 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/locale'
[DEBUG 2020-06-26T13:25:31 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.5/locale'
[DEBUG 2020-06-26T13:25:31 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.22.0/locale'
[ INFO 2020-06-26T13:25:31 HammerCLI::MainCommand] Called with options: {"option_debug"=>true}
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::ActivationKeyCommand::ListCommand:
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::ActivationKeyCommand::ListCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil}
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::ActivationKeyCommand::ListCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000004458d88>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil}
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for all except nothing on HammerCLIKatello::ActivationKeyCommand::ListCommand.
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::ActivationKeyCommand::CreateCommand:
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::ActivationKeyCommand::CreateCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil}
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::ActivationKeyCommand::CreateCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000004458d88>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil}
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for all except nothing on HammerCLIKatello::ActivationKeyCommand::CreateCommand.
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::ActivationKeyCommand::UpdateCommand:
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::ActivationKeyCommand::UpdateCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil}
[DEBUG 2020-06-26T13:25:31 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::ActivationKeyCommand::UpdateCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000004458d88>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil}
[ INFO 2020-06-26T13:25:31 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for all except nothing on HammerCLIKatello::ActivationKeyCommand::UpdateCommand.
[DEBUG 2020-06-26T13:25:31 HammerCLIForeman::CommandExtensions::OptionSources] Called block for HammerCLIForeman::Command option sources:
#<Proc:0x00000000038044b0@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/option_sources.rb:6>
[ INFO 2020-06-26T13:25:31 HammerCLIKatello::ActivationKeyCommand] Called with options: {}
[DEBUG 2020-06-26T13:25:31 HammerCLIForeman::CommandExtensions::OptionSources] Called block for HammerCLIForeman::Command option sources:
#<Proc:0x00000000038044b0@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/command_extensions/option_sources.rb:6>
[ INFO 2020-06-26T13:25:31 API] Server: https://katello2.openlogic.local
[ INFO 2020-06-26T13:25:31 API] GET /katello/api/subscriptions
[DEBUG 2020-06-26T13:25:31 API] Params: {
"name" => "Centos 7",
:per_page => 1000,
:page => 1
}
[DEBUG 2020-06-26T13:25:31 API] Headers: {
:params => {
"name" => "Centos 7",
:per_page => 1000,
:page => 1
}
}
[DEBUG 2020-06-26T13:25:31 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[DEBUG 2020-06-26T13:25:31 API] Response: {
"organization" => {},
"total" => 2,
"subtotal" => 2,
"page" => "1",
"per_page" => "1000",
"error" => nil,
"search" => nil,
"sort" => {
"by" => "name",
"order" => "asc"
},
"results" => [
[0] {
"id" => 3,
"cp_id" => "8a7ab16f72e614cf0172eb53b97d0046",
"subscription_id" => 3,
"name" => "Centos 7",
"start_date" => "2020-06-25 11:53:52 UTC",
"end_date" => "2049-12-01 00:00:00 UTC",
"available" => -1,
"quantity" => -1,
"consumed" => 1,
"account_number" => nil,
"contract_number" => nil,
"support_level" => nil,
"product_id" => "830514482705",
"sockets" => nil,
"cores" => nil,
"ram" => nil,
"instance_multiplier" => 1,
"stacking_id" => nil,
"multi_entitlement" => false,
"type" => "NORMAL",
"product_name" => "Centos 7",
"unmapped_guest" => false,
"virt_only" => false,
"virt_who" => false,
"upstream" => false,
"upstream_pool_id" => nil
},
[1] {
"id" => 1,
"cp_id" => "8a7ab16f72c81def0172c84bf2d3000f",
"subscription_id" => 1,
"name" => "Centos 8",
"start_date" => "2020-06-18 16:38:39 UTC",
"end_date" => "2049-12-01 00:00:00 UTC",
"available" => -1,
"quantity" => -1,
"consumed" => 0,
"account_number" => nil,
"contract_number" => nil,
"support_level" => nil,
"product_id" => "956393118704",
"sockets" => nil,
"cores" => nil,
"ram" => nil,
"instance_multiplier" => 1,
"stacking_id" => nil,
"multi_entitlement" => false,
"type" => "NORMAL",
"product_name" => "Centos 8",
"unmapped_guest" => false,
"virt_only" => false,
"virt_who" => false,
"upstream" => false,
"upstream_pool_id" => nil
}
]
}
[DEBUG 2020-06-26T13:25:31 API] Response headers: {
:date => "Fri, 26 Jun 2020 17:25:31 GMT",
:server => "Apache",
:foreman_version => "2.1.0-rc2",
:foreman_api_version => "2",
:foreman_current_organization => "; ANY",
:foreman_current_location => "; ANY",
:content_type => "application/json; charset=utf-8",
:apipie_checksum => "f2ff3a108a13887c5cda1471029c7d370a0c9bdc",
:etag => "W/\"e63314479f780ee6a31df7dc19ed4fa3-gzip\"",
:cache_control => "max-age=0, private, must-revalidate",
:x_request_id => "f7f5df25-d707-4a19-b2ec-ff5ca94c60b8",
:x_runtime => "0.438741",
:strict_transport_security => "max-age=631139040; includeSubdomains",
:x_frame_options => "sameorigin",
:x_content_type_options => "nosniff",
:x_xss_protection => "1; mode=block",
:x_download_options => "noopen",
:x_permitted_cross_domain_policies => "none",
:content_security_policy => "default-src 'self'; child-src 'self'; connect-src 'self' ws: wss:; img-src 'self' data:; script-src 'unsafe-eval' 'unsafe-inline' 'self'; style-src 'unsafe-inline' 'self'",
:set_cookie => [
[0] "_session_id=edb7c29b66985352b0718aea1f5f0145; path=/; secure; HttpOnly; SameSite=Lax"
],
:via => "1.1 katello2.openlogic.local",
:vary => "Accept-Encoding",
:content_encoding => "gzip",
:content_length => "476"
}
[DEBUG 2020-06-26T13:25:31 Exception] Using exception handler HammerCLIKatello::ExceptionHandler#handle_general_exception
[ERROR 2020-06-26T13:25:31 Exception] Error: Found more than one subscription.
Could not add subscription to activation key:
Error: Found more than one subscription.
[ERROR 2020-06-26T13:25:31 Exception]
HammerCLIForeman::ResolverError (Found more than one subscription.):
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/id_resolver.rb:292:in `pick_result'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/id_resolver.rb:232:in `find_resource'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/id_resolver.rb:195:in `get_id'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/id_resolver.rb:183:in `block (2 levels) in define_id_finders'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/commands.rb:150:in `get_resource_id'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/option_sources/id_params.rb:23:in `block in get_options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/option_sources/id_params.rb:20:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-2.1.1/lib/hammer_cli_foreman/option_sources/id_params.rb:20:in `get_options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/options/sources/base.rb:8:in `process'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/options/processor_list.rb:22:in `block in process'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/options/processor_list.rb:21:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/options/processor_list.rb:21:in `inject'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/options/processor_list.rb:21:in `process'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/options/processor_list.rb:22:in `block in process'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/options/processor_list.rb:21:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/options/processor_list.rb:21:in `inject'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/options/processor_list.rb:21:in `process'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/options/option_collector.rb:17:in `all_options_raw'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/options/option_collector.rb:21:in `all_options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/options/option_collector.rb:25:in `options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/abstract.rb:357:in `options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-2.1.1/lib/hammer_cli/abstract.rb:91: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-2.1.1/lib/hammer_cli/abstract.rb:77: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-2.1.1/lib/hammer_cli/abstract.rb:77: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-2.1.1/lib/hammer_cli/abstract.rb:77: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-2.1.1/bin/hammer:147:in `<top (required)>'
/bin/hammer:23:in `load'
/bin/hammer:23:in `<main>'
As can be seen, there are two subscriptions, "Centos 7" and "Centos 8". Trying to select "Centos 7" to add an activation key fails, because the result it pulls back is both "Centos 7" and "Centos 8", with the error:
[ERROR 2020-06-26T13:25:31 Exception] Error: Found more than one subscription.
Could not add subscription to activation key:
Error: Found more than one subscription.
Even though it is clear, even from the results, that there is only one subscription that matches "Centos 7"