mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
put lock file in project root dir
This commit is contained in:
@@ -210,9 +210,9 @@ class ProjectOptions(models.Model):
|
|||||||
|
|
||||||
def get_lock_file(self):
|
def get_lock_file(self):
|
||||||
proj_path = self.get_project_path()
|
proj_path = self.get_project_path()
|
||||||
if proj_path:
|
if not proj_path:
|
||||||
return os.path.join(proj_path, 'tower_sync.lock')
|
return None
|
||||||
return None
|
return proj_path + '.lock'
|
||||||
|
|
||||||
|
|
||||||
class Project(UnifiedJobTemplate, ProjectOptions, ResourceMixin):
|
class Project(UnifiedJobTemplate, ProjectOptions, ResourceMixin):
|
||||||
|
|||||||
@@ -1326,7 +1326,7 @@ class RunProjectUpdate(BaseTask):
|
|||||||
def acquire_lock(self, instance, blocking=True):
|
def acquire_lock(self, instance, blocking=True):
|
||||||
lock_path = instance.get_lock_file()
|
lock_path = instance.get_lock_file()
|
||||||
if lock_path is None:
|
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
|
# May raise IOError
|
||||||
self.lock_fd = os.open(lock_path, os.O_RDONLY | os.O_CREAT)
|
self.lock_fd = os.open(lock_path, os.O_RDONLY | os.O_CREAT)
|
||||||
|
|||||||
Reference in New Issue
Block a user