summaryrefslogtreecommitdiff
path: root/lib/ansible/parsing
diff options
context:
space:
mode:
authorMatt Martz <matt@sivel.net>2019-07-03 10:37:33 -0500
committerGitHub <noreply@github.com>2019-07-03 10:37:33 -0500
commit737dbefd78cab9a4cad8ea32237fe9fc88798258 (patch)
tree20ce673cd2665bab670a544b81b2aa9770ccb533 /lib/ansible/parsing
parent16d6fcf5148e2a527f5c6e2603490a2e79500a91 (diff)
downloadansible-737dbefd78cab9a4cad8ea32237fe9fc88798258.tar.gz
Get copy tests passing with split controller/target (#58516)
* Get copy tests passing with split controller/target * Remove sudoers file * add missed set_fact
Diffstat (limited to 'lib/ansible/parsing')
-rw-r--r--lib/ansible/parsing/dataloader.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/ansible/parsing/dataloader.py b/lib/ansible/parsing/dataloader.py
index 1e15584d4c..3e8bce7096 100644
--- a/lib/ansible/parsing/dataloader.py
+++ b/lib/ansible/parsing/dataloader.py
@@ -273,8 +273,8 @@ class DataLoader:
:returns: An absolute path to the filename ``source`` if found
:raises: An AnsibleFileNotFound Exception if the file is found to exist in the search paths
'''
- b_dirname = to_bytes(dirname)
- b_source = to_bytes(source)
+ b_dirname = to_bytes(dirname, errors='surrogate_or_strict')
+ b_source = to_bytes(source, errors='surrogate_or_strict')
result = None
search = []
@@ -305,8 +305,8 @@ class DataLoader:
# always append basedir as last resort
# don't add dirname if user already is using it in source
if b_source.split(b'/')[0] != dirname:
- search.append(os.path.join(to_bytes(self.get_basedir()), b_dirname, b_source))
- search.append(os.path.join(to_bytes(self.get_basedir()), b_source))
+ search.append(os.path.join(to_bytes(self.get_basedir(), errors='surrogate_or_strict'), b_dirname, b_source))
+ search.append(os.path.join(to_bytes(self.get_basedir(), errors='surrogate_or_strict'), b_source))
display.debug(u'search_path:\n\t%s' % to_text(b'\n\t'.join(search)))
for b_candidate in search:
@@ -316,7 +316,7 @@ class DataLoader:
break
if result is None:
- raise AnsibleFileNotFound(file_name=source, paths=[to_text(p) for p in search])
+ raise AnsibleFileNotFound(file_name=source, paths=[to_native(p) for p in search])
return result