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

This commit is contained in:
Matt Martz 2019-06-27 14:05:43 -05:00 committed by Brian Coca
parent 20ad120829
commit 939e2b4c79
2 changed files with 4 additions and 1 deletions

View file

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

View file

@ -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)