diff --git a/awx/main/models/projects.py b/awx/main/models/projects.py index 4930494a3d..fec941ecaa 100644 --- a/awx/main/models/projects.py +++ b/awx/main/models/projects.py @@ -54,7 +54,7 @@ class ProjectOptions(models.Model): @classmethod def get_local_path_choices(cls): if os.path.exists(settings.PROJECTS_ROOT): - paths = [x for x in os.listdir(settings.PROJECTS_ROOT) + paths = [x.decode('utf-8') for x in os.listdir(settings.PROJECTS_ROOT) if os.path.isdir(os.path.join(settings.PROJECTS_ROOT, x)) and not x.startswith('.') and not x.startswith('_')] qs = Project.objects.filter(active=True) diff --git a/awx/main/tests/base.py b/awx/main/tests/base.py index 8da29fa53e..b2422ef93b 100644 --- a/awx/main/tests/base.py +++ b/awx/main/tests/base.py @@ -174,11 +174,15 @@ class BaseTestMixin(object): return results def make_project(self, name, description='', created_by=None, - playbook_content='', role_playbooks=None): + playbook_content='', role_playbooks=None, unicode_prefix=True): if not os.path.exists(settings.PROJECTS_ROOT): os.makedirs(settings.PROJECTS_ROOT) # Create temp project directory. - project_dir = tempfile.mkdtemp(dir=settings.PROJECTS_ROOT) + if unicode_prefix: + tmp_prefix = u'\u2620tmp' + else: + tmp_prefix = 'tmp' + project_dir = tempfile.mkdtemp(prefix=tmp_prefix, dir=settings.PROJECTS_ROOT) self._temp_paths.append(project_dir) # Create temp playbook in project (if playbook content is given). if playbook_content: