fixes ANSIBLE_DUPLICATE_YAML_DICT_KEY=error crashes (#66786)

* Fix #65366
pull/67099/head
tavery321 6 years ago committed by GitHub
parent 3b32f95fb3
commit 994a6b0c5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,3 @@
bugfixes:
- DUPLICATE_YAML_DICT_KEY - Fix error output when configuration option DUPLICATE_YAML_DICT_KEY is set to error
(https://github.com/ansible/ansible/issues/65366)

@ -76,7 +76,10 @@ class AnsibleConstructor(SafeConstructor):
if C.DUPLICATE_YAML_DICT_KEY == 'warn':
display.warning(msg)
elif C.DUPLICATE_YAML_DICT_KEY == 'error':
raise ConstructorError(to_native(msg))
raise ConstructorError(context=None, context_mark=None,
problem=to_native(msg),
problem_mark=node.start_mark,
note=None)
else:
# when 'ignore'
display.debug(msg)

Loading…
Cancel
Save