Project

General

Profile

Actions

Bug #12115

closed

badly formatted yaml prevents hammer from running

Added by Bryan Kearney over 9 years ago. Updated over 8 years ago.

Status:
Duplicate
Priority:
Normal
Category:
-
Target version:
-
Difficulty:
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1127275
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
  1. echo ":" > /etc/hammer/cli.modules.d/broken.yml
2. try to run hammer
  1. 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


Related issues 1 (0 open1 closed)

Is duplicate of Hammer CLI - Bug #14436: Hammer should provide more informative message for config file syntax errorsClosedTomáš Strachota04/01/2016Actions
Actions

Also available in: Atom PDF