1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Use unicode project path when searching for playbooks. Fixes https://trello.com/c/yJGDluu1

This commit is contained in:
Chris Church 2014-12-03 19:10:49 -05:00
parent 109988da13
commit 526e4f2a2c
2 changed files with 3 additions and 3 deletions

View File

@ -164,7 +164,7 @@ class ProjectOptions(models.Model):
results = []
project_path = self.get_project_path()
if project_path:
for dirpath, dirnames, filenames in os.walk(project_path):
for dirpath, dirnames, filenames in os.walk(unicode(project_path)):
for filename in filenames:
if os.path.splitext(filename)[-1] not in ['.yml', '.yaml']:
continue

View File

@ -182,7 +182,7 @@ class BaseTestMixin(object):
self._temp_paths.append(project_dir)
# Create temp playbook in project (if playbook content is given).
if playbook_content:
handle, playbook_path = tempfile.mkstemp(suffix='.yml',
handle, playbook_path = tempfile.mkstemp(suffix=u'\u2620.yml',
dir=project_dir)
test_playbook_file = os.fdopen(handle, 'w')
test_playbook_file.write(playbook_content.encode('utf-8'))
@ -210,7 +210,7 @@ class BaseTestMixin(object):
self.object_ctr = self.object_ctr + 1
results.append(self.make_project(
name="proj%s-%s" % (x, self.object_ctr),
description="proj%s" % x,
description=u"proj%s" % x,
created_by=created_by,
playbook_content=playbook_content,
role_playbooks=role_playbooks,