Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion compute/oslogin/oslogin_service_account_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ def run_ssh(cmd: str, private_key_file: str, username: str, hostname: str) -> st
time.sleep(30)
tries += 1
if tries == 3:
print(f"Failed to execute SSH command (return code: {err.returncode}. Output received: {err.output}")
if isinstance(subprocess.CalledProcessError, err):
print(f"Failed to execute SSH command (return code: {err.returncode}. Output received: {err.output}")
else:
print("Failed to execute SSH - timed out.")
raise err
else:
return ssh.stdout
Expand Down