mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 12:41:19 -03:30
put lock file in project root dir
This commit is contained in:
parent
648aa470d7
commit
7919c47370
@ -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):
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user