Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config parsing does not handle error very well #9

Open
degremont opened this issue May 16, 2013 · 0 comments
Open

Config parsing does not handle error very well #9

degremont opened this issue May 16, 2013 · 0 comments

Comments

@degremont
Copy link
Collaborator

Configuration parsing has trouble to detect some errors or report them in a clear way.
By example:

Bad error message when some '---' line is not set
If 2 consecutives services are declared in a YAML file, but "---" is missing, the error message will be:

ERROR: Unexpected exception: 'service2_name' 

With a configuration with 2 services with the same name, milkcheck uses the last one without any warning message

$ cat conf/two/example.yaml
services:
    local:
       desc: Simplest service declaration
       actions:
          status:
             cmd: /sbin/service crond status
    local:
       desc: Simplest service declaration (double definition)
       actions:
          start:
             cmd: /bin/true

$ milkcheck -c conf/two status
$ milkcheck -c conf/two start
local - Simplest service declaration (double definition) [ OK ]

A interesting method to fix this could be to use the advanced features from PyYAML library and see if we cannot overload/create new classes to parse the yaml stream and automatically instanciate objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant