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.
This commit is contained in:
Jeff Bradberry 2019-02-15 14:28:58 -05:00
parent cf75ea91a1
commit 4d06ae48d3

View File

@ -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