From 390e1f9a0a9dd089576ec11d82f4f8e4ed5c30cf Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Thu, 24 Jun 2021 14:00:53 -0400 Subject: [PATCH] Fix obvious logical bug with project folder pre-creation (#5155) --- awx/main/tasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 8b2dea2014..b5d1ae397f 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -2178,8 +2178,6 @@ class RunProjectUpdate(BaseTask): if not os.path.exists(settings.PROJECTS_ROOT): os.mkdir(settings.PROJECTS_ROOT) project_path = instance.project.get_project_path(check_if_exists=False) - if not os.path.exists(project_path): - os.makedirs(project_path) # used as container mount self.acquire_lock(instance) @@ -2192,6 +2190,9 @@ class RunProjectUpdate(BaseTask): else: self.original_branch = git_repo.active_branch + if not os.path.exists(project_path): + os.makedirs(project_path) # used as container mount + stage_path = os.path.join(instance.get_cache_path(), 'stage') if os.path.exists(stage_path): logger.warning('{0} unexpectedly existed before update'.format(stage_path))