Protect the system from when one attempts to start a job without an inventory

This commit is contained in:
Matthew Jones
2015-01-08 14:55:58 -05:00
parent 80b2b36bf3
commit 0eaf2dc00c
3 changed files with 5 additions and 1 deletions

View File

@@ -417,6 +417,8 @@ class Job(UnifiedJob, JobOptions):
def generate_dependencies(self, active_tasks):
from awx.main.models import InventoryUpdate, ProjectUpdate
if self.inventory is None or self.project is None:
return []
inventory_sources = self.inventory.inventory_sources.filter(active=True, update_on_launch=True)
project_found = False
inventory_sources_found = []