mirror of
https://github.com/thegeeklab/ansible-doctor.git
synced 2024-11-21 20:30:43 +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():
|
for key, value in data.items():
|
||||||
self._data["var"][key] = {"value": {key: value}}
|
self._data["var"][key] = {"value": {key: value}}
|
||||||
except (
|
except (
|
||||||
ruamel.yaml.composer.ComposerError, ruamel.yaml.scanner.ScannerError,
|
ruamel.yaml.composer.ComposerError,
|
||||||
ruamel.yaml.constructor.ConstructorError
|
ruamel.yaml.scanner.ScannerError,
|
||||||
|
ruamel.yaml.constructor.ConstructorError,
|
||||||
|
ruamel.yaml.constructor.DuplicateKeyError,
|
||||||
) as e:
|
) as e:
|
||||||
message = "{} {}".format(e.context, e.problem)
|
message = "{} {}".format(e.context, e.problem)
|
||||||
self.log.sysexit_with_message(
|
self.log.sysexit_with_message(
|
||||||
|
Loading…
Reference in New Issue
Block a user