summaryrefslogtreecommitdiff
path: root/lib/ansible/inventory/dir.py
diff options
context:
space:
mode:
authorRobin Roth <robin.roth@kit.edu>2016-10-10 14:59:16 +0200
committerToshio Kuratomi <a.badger@gmail.com>2016-10-15 16:54:51 -0700
commit392232895491aca2e4f65331131103f4f2ea5b7d (patch)
treeb946d60446886e98363c1281d57cfaa0cd6265eb /lib/ansible/inventory/dir.py
parentc661f9f561437edfbc6f8293aa3e29ac38572808 (diff)
downloadansible-392232895491aca2e4f65331131103f4f2ea5b7d.tar.gz
Allow unicode inventory filename
Fixes #17932
Diffstat (limited to 'lib/ansible/inventory/dir.py')
-rw-r--r--lib/ansible/inventory/dir.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/inventory/dir.py b/lib/ansible/inventory/dir.py
index bb25a27121..c284dcf1b5 100644
--- a/lib/ansible/inventory/dir.py
+++ b/lib/ansible/inventory/dir.py
@@ -70,7 +70,7 @@ def get_file_parser(hostsfile, groups, loader):
parser = InventoryYAMLParser(loader=loader, groups=groups, filename=hostsfile)
processed = True
except Exception as e:
- myerr.append('Attempted to read "%s" as YAML: %s' % (hostsfile, to_native(e)))
+ myerr.append('Attempted to read "%s" as YAML: %s' % (to_native(hostsfile), to_native(e)))
# ini
if not processed and not shebang_present:
@@ -78,7 +78,7 @@ def get_file_parser(hostsfile, groups, loader):
parser = InventoryINIParser(loader=loader, groups=groups, filename=hostsfile)
processed = True
except Exception as e:
- myerr.append('Attempted to read "%s" as ini file: %s ' % (hostsfile, to_native(e)))
+ myerr.append('Attempted to read "%s" as ini file: %s ' % (to_native(hostsfile), to_native(e)))
if not processed and myerr:
raise AnsibleError('\n'.join(myerr))