mirror of
https://github.com/thegeeklab/ansible-doctor.git
synced 2024-11-24 13:50:42 +00:00
fix: catch duplicate key error on yaml load (#256)
This commit is contained in:
parent
d9b0178095
commit
307abeb3cb
@ -66,8 +66,10 @@ class Parser:
|
||||
for key, value in data.items():
|
||||
self._data["var"][key] = {"value": {key: value}}
|
||||
except (
|
||||
ruamel.yaml.composer.ComposerError, ruamel.yaml.scanner.ScannerError,
|
||||
ruamel.yaml.constructor.ConstructorError
|
||||
ruamel.yaml.composer.ComposerError,
|
||||
ruamel.yaml.scanner.ScannerError,
|
||||
ruamel.yaml.constructor.ConstructorError,
|
||||
ruamel.yaml.constructor.DuplicateKeyError,
|
||||
) as e:
|
||||
message = "{} {}".format(e.context, e.problem)
|
||||
self.log.sysexit_with_message(
|
||||
|
Loading…
Reference in New Issue
Block a user