diff options
author | Matt Clay <matt@mystile.com> | 2019-01-14 13:06:47 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-14 13:06:47 -0800 |
commit | 465df0ef8d27d7fd534f521335db11490ebd43bc (patch) | |
tree | 08dcad3ddd2384fd9ed3f175d18cf0d322024110 /lib/ansible/plugins/vars | |
parent | 15b1a31aa8c1dc21689bd8030eadbc8c4a53eb04 (diff) | |
download | ansible-465df0ef8d27d7fd534f521335db11490ebd43bc.tar.gz |
Fix encoding issues with file paths. (#50830)
* Fix encoding issues with file paths.
Discovered while testing with ANSIBLE_CONFIG env var set to a path
that contained unicode characters while LC_ALL=C.
* Fix unit tests.
* Fix another path encoding issue.
Diffstat (limited to 'lib/ansible/plugins/vars')
-rw-r--r-- | lib/ansible/plugins/vars/host_group_vars.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/plugins/vars/host_group_vars.py b/lib/ansible/plugins/vars/host_group_vars.py index fd80a0c304..5a412e215d 100644 --- a/lib/ansible/plugins/vars/host_group_vars.py +++ b/lib/ansible/plugins/vars/host_group_vars.py @@ -77,12 +77,12 @@ class VarsModule(BaseVarsPlugin): try: found_files = [] # load vars - opath = os.path.realpath(os.path.join(self._basedir, subdir)) + b_opath = os.path.realpath(to_bytes(os.path.join(self._basedir, subdir))) + opath = to_text(b_opath) key = '%s.%s' % (entity.name, opath) if cache and key in FOUND: found_files = FOUND[key] else: - b_opath = to_bytes(opath) # no need to do much if path does not exist for basedir if os.path.exists(b_opath): if os.path.isdir(b_opath): |