mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 13:55:04 -02:30
SCM inventory cancel propagation
For manually initiated inventory updates, also cancel the source project of "sync" type, like jobs do For automatic inventory updates spawned from source project update, of launch type "scm", handle contigency cases
This commit is contained in:
@@ -1391,6 +1391,15 @@ class RunProjectUpdate(BaseTask):
|
||||
except Exception as e:
|
||||
# A failed file update does not block other actions
|
||||
logger.error('Encountered error updating project dependent inventory: {}'.format(e))
|
||||
|
||||
# Stop all dependent inventory updates if project update was canceled
|
||||
project_update.refresh_from_db()
|
||||
if project_update.cancel_flag:
|
||||
break
|
||||
# Don't update inventory scm_revision if update was canceled
|
||||
local_inv_update.refresh_from_db()
|
||||
if local_inv_update.cancel_flag:
|
||||
continue
|
||||
inv_src.scm_last_revision = scm_revision
|
||||
inv_src.save(update_fields=['scm_last_revision'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user