Use the filename from AnsibleFileNotFound instead of the included file. Fixes #58436 (#58464)

pull/58475/head
Matt Martz 7 years ago committed by Brian Coca
parent 20ad120829
commit 939e2b4c79

@ -0,0 +1,3 @@
bugfixes:
- includes - Ensure to use the correct filename when AnsibleFileNotFound is
encountered (https://github.com/ansible/ansible/issues/58436)

@ -814,7 +814,7 @@ class StrategyBase:
except AnsibleError as e:
if isinstance(e, AnsibleFileNotFound):
reason = "Could not find or access '%s' on the Ansible Controller." % to_text(included_file._filename)
reason = "Could not find or access '%s' on the Ansible Controller." % to_text(e.file_name)
else:
reason = to_text(e)

Loading…
Cancel
Save