summaryrefslogtreecommitdiff
path: root/lib/ansible/inventory
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2016-01-06 15:18:22 -0800
committerToshio Kuratomi <toshio@fedoraproject.org>2016-01-06 15:19:40 -0800
commit46903c80faaf2a73056e7b9fbd52085291b4931f (patch)
tree9b429b10c16e682118abc6d19be50ed870d24601 /lib/ansible/inventory
parent669b311dbebbd1d226a637181d318e50b85dc911 (diff)
downloadansible-46903c80faaf2a73056e7b9fbd52085291b4931f.tar.gz
More fixes for unicode handling in the connection plugins.
Tested that ssh, docker, local, lxc-libvirt, chroot all work with the updated unicode integration test.
Diffstat (limited to 'lib/ansible/inventory')
-rw-r--r--lib/ansible/inventory/script.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ansible/inventory/script.py b/lib/ansible/inventory/script.py
index 6dfb1d2af0..cdfe676bcd 100644
--- a/lib/ansible/inventory/script.py
+++ b/lib/ansible/inventory/script.py
@@ -31,6 +31,7 @@ from ansible.errors import AnsibleError
from ansible.inventory.host import Host
from ansible.inventory.group import Group
from ansible.module_utils.basic import json_dict_bytes_to_unicode
+from ansible.utils.unicode import to_str
class InventoryScript:
@@ -72,11 +73,11 @@ class InventoryScript:
self.raw = self._loader.load(self.data)
except Exception as e:
sys.stderr.write(err + "\n")
- raise AnsibleError("failed to parse executable inventory script results from {0}: {1}".format(self.filename, str(e)))
+ raise AnsibleError("failed to parse executable inventory script results from {0}: {1}".format(to_str(self.filename_, to_str(e)))
if not isinstance(self.raw, Mapping):
sys.stderr.write(err + "\n")
- raise AnsibleError("failed to parse executable inventory script results from {0}: data needs to be formatted as a json dict".format(self.filename))
+ raise AnsibleError("failed to parse executable inventory script results from {0}: data needs to be formatted as a json dict".format(to_str(self.filename)))
self.raw = json_dict_bytes_to_unicode(self.raw)