Skip to content

Commit ff9bf01

Browse files
committed
fix another issue with unset credentials (fix #84)
1 parent 4e9a550 commit ff9bf01

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/ansibleguy-webui/aw/execute/play_credentials.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,20 @@ def get_credentials_to_use(job: Job, execution: JobExecution) -> (BaseJobCredent
9191
def get_runner_credential_args(creds: BaseJobCredentials) -> dict:
9292
args = {}
9393

94-
if is_set(creds.ssh_key):
95-
args['ssh_key'] = creds.ssh_key
94+
if is_set(creds):
95+
if is_set(creds.ssh_key):
96+
args['ssh_key'] = creds.ssh_key
9697

97-
if is_set(creds.connect_pass) or is_set(creds.become_pass) or is_set(creds.vault_pass):
98-
args['passwords'] = {}
98+
if is_set(creds.connect_pass) or is_set(creds.become_pass) or is_set(creds.vault_pass):
99+
args['passwords'] = {}
99100

100-
if is_set(creds.connect_pass):
101-
args['passwords'][r'^SSH\s[pP]assword:\s*$'] = creds.connect_pass
101+
if is_set(creds.connect_pass):
102+
args['passwords'][r'^SSH\s[pP]assword:\s*$'] = creds.connect_pass
102103

103-
if is_set(creds.become_pass):
104-
args['passwords'][r'^BECOME\s[pP]assword:\s*$'] = creds.become_pass
104+
if is_set(creds.become_pass):
105+
args['passwords'][r'^BECOME\s[pP]assword:\s*$'] = creds.become_pass
105106

106-
if is_set(creds.vault_pass):
107-
args['passwords'][r'^Vault\s[pP]assword:\s*$'] = creds.vault_pass
107+
if is_set(creds.vault_pass):
108+
args['passwords'][r'^Vault\s[pP]assword:\s*$'] = creds.vault_pass
108109

109110
return args

0 commit comments

Comments
 (0)