mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 12:20:45 -03:30
Merge pull request #5571 from chrismeyersfsu/fix-5566
cancel jobs dependent on inv update
This commit is contained in:
commit
e6e636f247
@ -23,6 +23,7 @@ from awx.main.fields import AutoOneToOneField, ImplicitRoleField
|
||||
from awx.main.managers import HostManager
|
||||
from awx.main.models.base import * # noqa
|
||||
from awx.main.models.unified_jobs import * # noqa
|
||||
from awx.main.models.jobs import Job
|
||||
from awx.main.models.mixins import ResourceMixin
|
||||
from awx.main.models.notifications import (
|
||||
NotificationTemplate,
|
||||
@ -1276,6 +1277,12 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions, JobNotificationMixin):
|
||||
def get_notification_friendly_name(self):
|
||||
return "Inventory Update"
|
||||
|
||||
def cancel(self):
|
||||
res = super(InventoryUpdate, self).cancel()
|
||||
if res:
|
||||
map(lambda x: x.cancel(), Job.objects.filter(dependent_jobs__in=[self.id]))
|
||||
return res
|
||||
|
||||
|
||||
class CustomInventoryScript(CommonModelNameNotUnique, ResourceMixin):
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user