fill in network ssh password protected keys

This commit is contained in:
chris meyers 2018-08-09 12:06:46 -04:00
parent bb5aeb5cf1
commit f5aed74503

View File

@ -1119,6 +1119,18 @@ class RunJob(BaseTask):
if value not in ('', 'ASK'):
passwords[field] = value
'''
Only 1 value can be provided for a unique prompt string. Prefer ssh
key unlock over network key unlock.
'''
if 'ssh_key_unlock' not in passwords:
for cred in job.network_credentials:
if cred.inputs.get('ssh_key_unlock'):
passwords['ssh_key_unlock'] = kwargs.get(
'ssh_key_unlock',
decrypt_field(cred, 'ssh_key_unlock')
)
return passwords
def build_env(self, job, **kwargs):