Remove redundant undefined error message (#81867)

Fixes: #78703

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/82628/head
Abhijeet Kasurde 2 years ago committed by GitHub
parent bec27fb4c0
commit 7a0c321054
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,3 @@
---
bugfixes:
- Do not print undefined error message twice (https://github.com/ansible/ansible/issues/78703).

@ -1011,10 +1011,14 @@ class Templar:
if unsafe:
res = wrap_var(res)
return res
except (UndefinedError, AnsibleUndefinedVariable) as e:
except UndefinedError as e:
if fail_on_undefined:
raise AnsibleUndefinedVariable(e, orig_exc=e)
else:
raise AnsibleUndefinedVariable(e)
display.debug("Ignoring undefined failure: %s" % to_text(e))
return data
except AnsibleUndefinedVariable as e:
if fail_on_undefined:
raise
display.debug("Ignoring undefined failure: %s" % to_text(e))
return data

@ -714,7 +714,7 @@
- name: check that proper error message is emitted when in operator is used
assert:
that: "\"'y' is undefined\" in error.msg"
that: "\"The error was: 'y' is undefined\n\n\" in error.msg"
- template:
src: template_import_macro_globals.j2

Loading…
Cancel
Save