mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-30 03:41:50 -05:00
Merge pull request #224 from chrismeyersfsu/feature-schedule_jobs_no_credentials_fail_fast
restrict the running of jobs
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user