From 4d06ae48d3f9af6e486aa63fbcd23b41765dac44 Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Fri, 15 Feb 2019 14:28:58 -0500 Subject: [PATCH] Deal with the (erroneous) case where a job is missing the inventory by bailing out of check_org_host_limit early. Validation catches this situation later on. --- awx/main/access.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/awx/main/access.py b/awx/main/access.py index 5600abb9a8..1c450f98f4 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -336,6 +336,9 @@ class BaseAccess(object): return inventory = get_object_from_data('inventory', Inventory, data) + if inventory is None: # In this case a missing inventory error is launched + return # further down the line, so just ignore it. + org = inventory.organization if org is None or org.max_hosts == 0: return