MatterMiners/cobald

Nicer YAML configuration error messages

Open

#54 opened on Oct 2, 2019

 (0 comments) (0 reactions) (0 assignees)Python (13 forks)auto 404
enhancementgood first issueusability

Repository metrics

Stars
 (11 stars)
PR merge metrics
 (PR metrics pending)

Description

Malformed YAML configuration files (including unsafe features) currently kill the daemon with a raw traceback (see #53). A human-readable error and possibly help message should be provided instead.

Better error message:

2019-10-02 14:55:40 (601034) Using configuration cobald_test.yml
2019-10-02 14:55:40 (601034) Failed to load cobald_test.yml:
SafeYAML does not support tag '!!python/object/apply:tardis.resources.poolfactory.create_composite_pool'
  in "cobald_test.yml", line 13, column 5

Better help message:

2019-10-02 14:55:40 (601034) Using configuration cobald_test.yml
2019-10-02 14:55:40 (601034) Failed to load cobald_test.yml:

COBalD YAML configuration files do not support arbitrary '!!python/object/apply' targets

11|    high_allocation: 0.90
12|    rate: 1
13|  - !!python/object/apply:tardis.resources.poolfactory.create_composite_pool
       ^^^^^^^^^^^^^^^^^^^^^

The tag target 'tardis.resources.poolfactory.create_composite_pool' is not safe for loading.
Register it as a plugin or mark it as safe.

HINT: See the configuration documentation at https://cobald.readthedocs.io/en/latest/source/daemon/config.html

Contributor guide