mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 11:41:08 -03: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:
@@ -501,6 +501,13 @@ class ProjectUpdate(UnifiedJob, ProjectOptions, JobNotificationMixin):
|
||||
update_fields.append('scm_delete_on_next_update')
|
||||
parent_instance.save(update_fields=update_fields)
|
||||
|
||||
def cancel(self, job_explanation=None):
|
||||
res = super(ProjectUpdate, self).cancel(job_explanation=job_explanation)
|
||||
if res and self.launch_type != 'sync':
|
||||
for inv_src in self.scm_inventory_updates.filter(status='running'):
|
||||
inv_src.cancel(job_explanation='Source project update `{}` was canceled.'.format(self.name))
|
||||
return res
|
||||
|
||||
'''
|
||||
JobNotificationMixin
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user