@@ -32,7 +32,8 @@ def __init__(self,
32
32
passphrase = None ,
33
33
timeout = 10 ,
34
34
totp_secret = None ,
35
- tar_compress = True
35
+ tar_compress = True ,
36
+ look_for_keys = True ,
36
37
):
37
38
38
39
self .hostname = hostname
@@ -45,6 +46,7 @@ def __init__(self,
45
46
self .totp_secret = totp_secret
46
47
self .ssh = None
47
48
self .tar_compress = tar_compress
49
+ self .look_for_keys = look_for_keys
48
50
self ._setup_ssh ()
49
51
50
52
# @classmethod
@@ -160,7 +162,7 @@ def _setup_ssh(self):
160
162
pass
161
163
if key is not None :
162
164
break
163
- else :
165
+ elif self . look_for_keys :
164
166
for keytype , name in [
165
167
(paramiko .RSAKey , "rsa" ),
166
168
(paramiko .DSSKey , "dsa" ),
@@ -298,6 +300,7 @@ def arginfo():
298
300
doc_totp_secret = 'Time-based one time password secret. It should be a base32-encoded string' \
299
301
' extracted from the 2D code.'
300
302
doc_tar_compress = 'The archive will be compressed in upload and download if it is True. If not, compression will be skipped.'
303
+ doc_look_for_keys = "enable searching for discoverable private key files in ~/.ssh/"
301
304
302
305
ssh_remote_profile_args = [
303
306
Argument ("hostname" , str , optional = False , doc = doc_hostname ),
@@ -309,6 +312,7 @@ def arginfo():
309
312
Argument ("timeout" , int , optional = True , default = 10 , doc = doc_timeout ),
310
313
Argument ("totp_secret" , str , optional = True , default = None , doc = doc_totp_secret ),
311
314
Argument ("tar_compress" , bool , optional = True , default = True , doc = doc_tar_compress ),
315
+ Argument ("look_for_keys" , bool , optional = True , default = True , doc = doc_look_for_keys ),
312
316
]
313
317
ssh_remote_profile_format = Argument ("ssh_session" , dict , ssh_remote_profile_args )
314
318
return ssh_remote_profile_format
0 commit comments