File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -25,10 +25,12 @@ def ssh_connect(host, port=22):
25
25
26
26
# if the password wasn't defined in settings, ask for it
27
27
if not ec2_ssh_key_password :
28
- ec2_ssh_key_password = getpass .getpass (prompt = '\n Found an encrypted private SSH key, please enter your decryption password: ' )
28
+ rsa_key_password = getpass .getpass (prompt = '\n Found an encrypted private SSH key, please enter your decryption password: ' )
29
+ else :
30
+ rsa_key_password = ec2_ssh_key_password
29
31
30
32
# setup the pkey object by reading the file from disk, with a decryption password
31
- rsa_key = paramiko .RSAKey .from_private_key_file (os .path .expanduser (ec2_ssh_key ), password = ec2_ssh_key_password )
33
+ rsa_key = paramiko .RSAKey .from_private_key_file (os .path .expanduser (ec2_ssh_key ), password = rsa_key_password )
32
34
33
35
# pass pkey object to connection
34
36
transport .connect (username = ec2_ssh_username , pkey = rsa_key )
You can’t perform that action at this time.
0 commit comments