Bug 1127275 - badly formatted yaml prevents hammer from running
Summary: badly formatted yaml prevents hammer from running
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer
Version: Unspecified
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: Unspecified
Assignee: Tomas Strachota
QA Contact: Lukas Pramuk
URL: http://projects.theforeman.org/issues...
Depends On:
TreeView+ depends on / blocked
Reported: 2014-08-06 14:04 UTC by Lukas Pramuk
Modified: 2019-04-01 20:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2018-02-21 16:49:54 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Foreman Issue Tracker 14436 None None None 2016-09-29 11:25:21 UTC

Description Lukas Pramuk 2014-08-06 14:04:46 UTC
Description of problem:
Badly formatted yaml prevents hammer from running, without any reasonable message, just traceback

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. prepare badly formatted yaml file
# echo ":" > /etc/hammer/cli.modules.d/broken.yml

2. try to run hammer
# 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/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:39
	from /usr/bin/hammer:19:in `load'
	from /usr/bin/hammer:19

Actual results:
badly formatted yaml prevents hammer from running without any reasonable message to the user

Expected results:
hammer tries to load yaml file and if fails then hammer will notify user about wrong yaml file and will keep running

Comment 1 RHEL Product and Program Management 2014-08-06 14:14:20 UTC
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.

Comment 3 Bryan Kearney 2015-10-08 20:42:26 UTC
Created redmine issue http://projects.theforeman.org/issues/12115 from this bug

Comment 4 Bryan Kearney 2016-09-29 12:03:35 UTC
Upstream bug assigned to tstrachota@redhat.com

Comment 5 Bryan Kearney 2016-09-29 12:03:39 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/14436 has been resolved.

Comment 7 Lukas Pramuk 2016-11-21 14:54:20 UTC


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

Comment 8 pm-sat@redhat.com 2018-02-21 16:49:54 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.