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:
Matthew Jones
2014-09-04 13:25:21 -04:00
parent e48309b6aa
commit 58b71ca9f9
6 changed files with 85 additions and 1 deletions

View File

@@ -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()