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.
Bug 1127275 - badly formatted yaml prevents hammer from running
Summary: badly formatted yaml prevents hammer from running
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: Unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Tomas Strachota
QA Contact: Lukas Pramuk
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-06 14:04 UTC by Lukas Pramuk
Modified: 2019-09-26 14:45 UTC (History)
3 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 14436 0 'Normal' 'Closed' 'Hammer should provide more informative message for config file syntax errors' 2019-11-19 11:20:48 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):
rubygem-hammer_cli-0.1.1-10.el6sat.noarch

How reproducible:
100%

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 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

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
VERIFIED.

@satellite-6.3.0-6.1.beta.el7sat.noarch
tfm-rubygem-hammer_cli-0.8.0-1.el7.noarch

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
Usage:
    hammer [OPTIONS] SUBCOMMAND [ARG] ...
...

>>> hammer issues warning about badly formated yaml and continues working

Comment 8 Satellite Program 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.

https://access.redhat.com/errata/RHSA-2018:0336


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