Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
When using Hammer commands from within hammer shell, when adding new organization_id default, shell creates a unknown string in name field, making any attempt of starting hammer CLI command and/OR Hammer shell break
Version-Release number of selected component (if applicable):
tfm-rubygem-hammer_cli-0.5.1.13-2.el7sat.noarch
How reproducible:
On a user without defaults.yml (Don't test with an existent defaults.yml file), run commands in this order:
[root@sat-master .hammer]# hammer shell
Welcome to the hammer interactive shell
Type 'help' for usage information
hammer> defaults list
----------|------
PARAMETER | VALUE
----------|------
hammer> defaults add --param-name organization_id --param-value 1
Added organization_id default-option with value 1.
hammer> defaults list
----------|------
PARAMETER | VALUE
----------|------
hammer>
[root@sat-master .hammer]# cat defaults.yml
---
:defaults:
:organization_id:
:value: !ruby/string:HammerCLI::CompleterWord
str: '1'
original: '1'
Steps to Reproduce:
1. Steps are provided above
Actual results:
This error is presented when invoking shell or any command from bash after adding a default value to organization_id:
[root@sat-master .hammer]# hammer shell
/opt/rh/rh-ruby22/root/usr/share/ruby/psych/class_loader.rb:53:in `path2class': undefined class/module HammerCLI::CompleterWord (ArgumentError)
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/class_loader.rb:53:in `resolve'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/class_loader.rb:45:in `find'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/class_loader.rb:27:in `load'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:379:in `resolve_class'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:212:in `visit_Psych_Nodes_Mapping'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:15:in `visit'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:5:in `accept'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:31:in `accept'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:321:in `block in revive_hash'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `each'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `each_slice'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `revive_hash'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:15:in `visit'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:5:in `accept'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:31:in `accept'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:321:in `block in revive_hash'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `each'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `each_slice'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `revive_hash'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:15:in `visit'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:5:in `accept'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:31:in `accept'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:321:in `block in revive_hash'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `each'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `each_slice'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `revive_hash'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:15:in `visit'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:5:in `accept'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:31:in `accept'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:295:in `visit_Psych_Nodes_Document'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:15:in `visit'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:5:in `accept'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:31:in `accept'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/nodes/node.rb:37:in `to_ruby'
from /opt/rh/rh-ruby22/root/usr/share/ruby/psych.rb:246:in `load'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/lib/hammer_cli/settings.rb:37:in `load_from_file'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/lib/hammer_cli/settings.rb:21:in `block in load_from_paths'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/lib/hammer_cli/settings.rb:16:in `each'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/lib/hammer_cli/settings.rb:16:in `load_from_paths'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/bin/hammer:49:in `<top (required)>'
from /usr/bin/hammer:23:in `load'
from /usr/bin/hammer:23:in `<main>'
Expected results:
Default values added without any problem to defaults.yml file and hammer shell or hammer CLI runs without any problem.
Additional info:
Workaround:
-- Delete 'corrupted' defaults.yml file;
-- Run default command from bash itself:
[root@sat-master .hammer]# hammer defaults add --param-name organization_id --param-value 1
Added organization_id default-option with value 1.
[root@sat-master .hammer]# ls
defaults.yml history log
[root@sat-master .hammer]# cat defaults.yml
---
:defaults:
:organization_id:
:value: '1'
[root@sat-master .hammer]# hammer shell
Welcome to the hammer interactive shell
Type 'help' for usage information
hammer>
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
For information on the advisory, and where to find the updated files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2018:0336
Description of problem: When using Hammer commands from within hammer shell, when adding new organization_id default, shell creates a unknown string in name field, making any attempt of starting hammer CLI command and/OR Hammer shell break Version-Release number of selected component (if applicable): tfm-rubygem-hammer_cli-0.5.1.13-2.el7sat.noarch How reproducible: On a user without defaults.yml (Don't test with an existent defaults.yml file), run commands in this order: [root@sat-master .hammer]# hammer shell Welcome to the hammer interactive shell Type 'help' for usage information hammer> defaults list ----------|------ PARAMETER | VALUE ----------|------ hammer> defaults add --param-name organization_id --param-value 1 Added organization_id default-option with value 1. hammer> defaults list ----------|------ PARAMETER | VALUE ----------|------ hammer> [root@sat-master .hammer]# cat defaults.yml --- :defaults: :organization_id: :value: !ruby/string:HammerCLI::CompleterWord str: '1' original: '1' Steps to Reproduce: 1. Steps are provided above Actual results: This error is presented when invoking shell or any command from bash after adding a default value to organization_id: [root@sat-master .hammer]# hammer shell /opt/rh/rh-ruby22/root/usr/share/ruby/psych/class_loader.rb:53:in `path2class': undefined class/module HammerCLI::CompleterWord (ArgumentError) from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/class_loader.rb:53:in `resolve' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/class_loader.rb:45:in `find' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/class_loader.rb:27:in `load' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:379:in `resolve_class' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:212:in `visit_Psych_Nodes_Mapping' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:15:in `visit' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:5:in `accept' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:31:in `accept' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:321:in `block in revive_hash' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `each' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `each_slice' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `revive_hash' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:15:in `visit' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:5:in `accept' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:31:in `accept' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:321:in `block in revive_hash' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `each' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `each_slice' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `revive_hash' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:15:in `visit' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:5:in `accept' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:31:in `accept' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:321:in `block in revive_hash' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `each' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `each_slice' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:319:in `revive_hash' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:15:in `visit' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:5:in `accept' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:31:in `accept' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:295:in `visit_Psych_Nodes_Document' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:15:in `visit' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/visitor.rb:5:in `accept' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/visitors/to_ruby.rb:31:in `accept' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych/nodes/node.rb:37:in `to_ruby' from /opt/rh/rh-ruby22/root/usr/share/ruby/psych.rb:246:in `load' from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/lib/hammer_cli/settings.rb:37:in `load_from_file' from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/lib/hammer_cli/settings.rb:21:in `block in load_from_paths' from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/lib/hammer_cli/settings.rb:16:in `each' from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/lib/hammer_cli/settings.rb:16:in `load_from_paths' from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/bin/hammer:49:in `<top (required)>' from /usr/bin/hammer:23:in `load' from /usr/bin/hammer:23:in `<main>' Expected results: Default values added without any problem to defaults.yml file and hammer shell or hammer CLI runs without any problem. Additional info: Workaround: -- Delete 'corrupted' defaults.yml file; -- Run default command from bash itself: [root@sat-master .hammer]# hammer defaults add --param-name organization_id --param-value 1 Added organization_id default-option with value 1. [root@sat-master .hammer]# ls defaults.yml history log [root@sat-master .hammer]# cat defaults.yml --- :defaults: :organization_id: :value: '1' [root@sat-master .hammer]# hammer shell Welcome to the hammer interactive shell Type 'help' for usage information hammer>