Skip to content

Commit

Permalink
Fix obvious logical bug with project folder pre-creation (ansible#5155)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCoding authored and shanemcd committed Jun 28, 2021
1 parent 48d916b commit e863623
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions awx/main/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2178,8 +2178,6 @@ def pre_run_hook(self, instance, private_data_dir):
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)

Expand All @@ -2192,6 +2190,9 @@ def pre_run_hook(self, instance, private_data_dir):
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))
Expand Down

0 comments on commit e863623

Please sign in to comment.