Description of problem:
Badly formatted yaml prevents hammer from running, without any reasonable message, just traceback
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. prepare badly formatted yaml file
# echo ":" > /etc/hammer/cli.modules.d/broken.yml
2. try to run hammer
/usr/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 0, col 1: `:' (ArgumentError)
from /usr/lib/ruby/1.8/yaml.rb:133:in `load'
from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/settings.rb:38:in `load_from_file'
from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/settings.rb:25:in `load_from_paths'
from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/settings.rb:24:in `each'
from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/settings.rb:24:in `load_from_paths'
from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/settings.rb:16:in `each'
from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/settings.rb:16:in `load_from_paths'
from /usr/bin/hammer:19:in `load'
badly formatted yaml prevents hammer from running without any reasonable message to the user
hammer tries to load yaml file and if fails then hammer will notify user about wrong yaml file and will keep running
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.
Created redmine issue http://projects.theforeman.org/issues/12115 from this bug
Upstream bug assigned to email@example.com
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/14436 has been resolved.
by reproducer in comment#0:
1. # echo ":" > /etc/hammer/cli.modules.d/broken.yml
2. # hammer
Warning: Couldn't load configuration file /etc/hammer/cli.modules.d/broken.yml: (<unknown>): did not find expected key while parsing a block mapping at line 1 column 1
hammer [OPTIONS] SUBCOMMAND [ARG] ...
>>> hammer issues warning about badly formated yaml and continues working
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.