From 633da940a826cae78217e93768de5bdcc02ba21c Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Mon, 1 May 2017 11:15:18 -0400 Subject: [PATCH] create .lock file without needing the proj dir to exist * We create .lock file in the tower project root directory. This should not require that the project directory exists, only that the project directory name is generatable. --- awx/main/models/projects.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/awx/main/models/projects.py b/awx/main/models/projects.py index a49046e0eb..fe767a6a38 100644 --- a/awx/main/models/projects.py +++ b/awx/main/models/projects.py @@ -209,7 +209,11 @@ class ProjectOptions(models.Model): return sorted(results, key=lambda x: smart_str(x).lower()) def get_lock_file(self): - proj_path = self.get_project_path() + ''' + We want the project path in name only, we don't care if it exists or + not. This method will just append .lock onto the full directory path. + ''' + proj_path = self.get_project_path(check_if_exists=False) if not proj_path: return None return proj_path + '.lock'