Skip to content

Commit

Permalink
fix: catch duplicate key error on yaml load (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoxys authored Mar 2, 2022
1 parent d9b0178 commit 307abeb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ansibledoctor/doc_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ def _parse_var_files(self):
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(
Expand Down

0 comments on commit 307abeb

Please sign in to comment.