mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 08:48:46 -03:30
Fix up unicode project directory issue, with unit tests
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user