Merge pull request #224 from chrismeyersfsu/feature-schedule_jobs_no_credentials_fail_fast

restrict the running of jobs
This commit is contained in:
Chris Meyers
2015-05-21 13:23:44 -04:00
5 changed files with 116 additions and 63 deletions

View File

@@ -1249,6 +1249,19 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions):
def task_impact(self):
return 50
# InventoryUpdate credential required
# Custom InventoryUpdate credential not required
@property
def can_start(self):
if not super(InventoryUpdate, self).can_start:
return False
if (self.source != 'custom'
and not (self.credential and self.credential.active)):
return False
return True
class CustomInventoryScript(CommonModelNameNotUnique):
class Meta: