fixes ANSIBLE_DUPLICATE_YAML_DICT_KEY=error crashes (#66786)
* Fix #65366
This commit is contained in:
parent
3b32f95fb3
commit
994a6b0c5a
2 changed files with 7 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue