From c1bace87ab7f417dc745fe39a47685365de7a7d9 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Mon, 27 Feb 2017 11:37:29 -0500 Subject: [PATCH] only cancel deps if we can cancel the inv update --- awx/main/models/inventory.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/main/models/inventory.py b/awx/main/models/inventory.py index 1e156986f1..387277c5e9 100644 --- a/awx/main/models/inventory.py +++ b/awx/main/models/inventory.py @@ -1279,7 +1279,8 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions, JobNotificationMixin): def cancel(self): res = super(InventoryUpdate, self).cancel() - map(lambda x: x.cancel(), Job.objects.filter(dependent_jobs__in=[self.id])) + if res: + map(lambda x: x.cancel(), Job.objects.filter(dependent_jobs__in=[self.id])) return res