conservative method to validating that a job can be launched from a node

This commit is contained in:
AlanCoding
2017-01-18 12:11:31 -05:00
parent cf07e08c54
commit a8e46021f8
3 changed files with 11 additions and 6 deletions

View File

@@ -606,11 +606,10 @@ 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 _resources_sufficient_for_launch(self):
if self.job_type == PERM_INVENTORY_SCAN:
return self.inventory_id is not None
return not (self.inventory_id is None or self.project_id is None)
def display_artifacts(self):
'''