mirror of
https://github.com/ansible/awx.git
synced 2026-08-05 20:40:01 -02:30
Implement /launch endpoint on job template
Partial implementation of: https://trello.com/c/7uXHs7ze/14-require-admin-to-be-able-to-run-a-job-without-a-job-template
This commit is contained in:
@@ -189,6 +189,18 @@ class JobTemplate(UnifiedJobTemplate, JobOptions):
|
||||
needed.append(pw)
|
||||
return bool(self.credential and not len(needed))
|
||||
|
||||
@property
|
||||
def passwords_needed_to_start(self):
|
||||
'''Return list of password field names needed to start the job.'''
|
||||
needed = []
|
||||
if self.credential:
|
||||
for pw in self.credential.passwords_needed:
|
||||
if pw == 'password':
|
||||
needed.append('ssh_password')
|
||||
else:
|
||||
needed.append(pw)
|
||||
return needed
|
||||
|
||||
def _can_update(self):
|
||||
return self.can_start_without_user_input()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user