graceful handling of null project and inventory in workflow

This commit is contained in:
AlanCoding
2017-01-13 16:34:38 -05:00
parent 044df78e11
commit 5bfb0f229c
2 changed files with 9 additions and 1 deletions

View File

@@ -606,6 +606,12 @@ class Job(UnifiedJob, JobOptions, SurveyJobMixin, JobNotificationMixin):
evars.update(extra_vars)
self.update_fields(extra_vars=json.dumps(evars))
def signal_start(self, **kwargs):
# Block cases that would cause the task manager to error
if self.inventory_id is None or self.project_id is None:
return False
return super(Job, self).signal_start(**kwargs)
def display_artifacts(self):
'''
Hides artifacts if they are marked as no_log type artifacts.