diff --git a/awx/main/models/projects.py b/awx/main/models/projects.py index 79c2183964..a49046e0eb 100644 --- a/awx/main/models/projects.py +++ b/awx/main/models/projects.py @@ -210,9 +210,9 @@ class ProjectOptions(models.Model): def get_lock_file(self): proj_path = self.get_project_path() - if proj_path: - return os.path.join(proj_path, 'tower_sync.lock') - return None + if not proj_path: + return None + return proj_path + '.lock' class Project(UnifiedJobTemplate, ProjectOptions, ResourceMixin): diff --git a/awx/main/tasks.py b/awx/main/tasks.py index b0e8a5b698..1078b6a76f 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -1326,7 +1326,7 @@ class RunProjectUpdate(BaseTask): def acquire_lock(self, instance, blocking=True): lock_path = instance.get_lock_file() if lock_path is None: - raise RuntimeError(u'Invalid file %s' % instance.get_lock_file()) + raise RuntimeError(u'Invalid lock file path') # May raise IOError self.lock_fd = os.open(lock_path, os.O_RDONLY | os.O_CREAT)