summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2019-01-17 09:18:01 -0800
committerBrian Coca <bcoca@users.noreply.github.com>2019-01-17 12:18:01 -0500
commita864247bd5cec2058fed378ef8a26e45b480a32f (patch)
tree9a22b98c51e38b2bd3da760dd5b58d61bca88ad6
parent9fa46e7f946bfe244d0e126bd96588b460592826 (diff)
downloadansible-a864247bd5cec2058fed378ef8a26e45b480a32f.tar.gz
Encoding fixes for plugin loader and vault. (#51002)
-rw-r--r--lib/ansible/cli/__init__.py2
-rw-r--r--lib/ansible/plugins/loader.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/ansible/cli/__init__.py b/lib/ansible/cli/__init__.py
index 5fc33c285a..b09d9abf58 100644
--- a/lib/ansible/cli/__init__.py
+++ b/lib/ansible/cli/__init__.py
@@ -234,7 +234,7 @@ class CLI(with_metaclass(ABCMeta, object)):
try:
file_vault_secret.load()
except AnsibleError as exc:
- display.warning('Error in vault password file loading (%s): %s' % (vault_id_name, exc))
+ display.warning('Error in vault password file loading (%s): %s' % (vault_id_name, to_text(exc)))
raise
if vault_id_name:
diff --git a/lib/ansible/plugins/loader.py b/lib/ansible/plugins/loader.py
index fad424d31c..4e45e98076 100644
--- a/lib/ansible/plugins/loader.py
+++ b/lib/ansible/plugins/loader.py
@@ -352,7 +352,7 @@ class PluginLoader:
warnings.simplefilter("ignore", RuntimeWarning)
with open(to_bytes(path), 'rb') as module_file:
# to_native is used here because imp.load_source's path is for tracebacks and python's traceback formatting uses native strings
- module = imp.load_source(full_name, to_native(path), module_file)
+ module = imp.load_source(to_native(full_name), to_native(path), module_file)
return module
def _update_object(self, obj, name, path):
@@ -622,7 +622,7 @@ def _load_plugin_filter():
if 'stat' in filters['ansible.modules']:
raise AnsibleError('The stat module was specified in the module blacklist file, {0}, but'
' Ansible will not function without the stat module. Please remove stat'
- ' from the blacklist.'.format(filter_cfg))
+ ' from the blacklist.'.format(to_native(filter_cfg)))
return filters