File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1766,11 +1766,14 @@ def _get_ssh_client(self):
1766
1766
config = paramiko .SSHConfig ()
1767
1767
config .parse (open (os .path .expanduser ('~/.ssh/config' )))
1768
1768
host = config .lookup (self .inputs .hostname )
1769
- proxy = paramiko .ProxyCommand (
1770
- subprocess .check_output (
1771
- [os .environ ['SHELL' ], '-c' , 'echo %s' % host ['proxycommand' ]]
1772
- ).strip ()
1773
- )
1769
+ if 'proxycommand' in host :
1770
+ proxy = paramiko .ProxyCommand (
1771
+ subprocess .check_output (
1772
+ [os .environ ['SHELL' ], '-c' , 'echo %s' % host ['proxycommand' ]]
1773
+ ).strip ()
1774
+ )
1775
+ else :
1776
+ proxy = None
1774
1777
client = paramiko .SSHClient ()
1775
1778
client .load_system_host_keys ()
1776
1779
client .set_missing_host_key_policy (paramiko .AutoAddPolicy ())
You can’t perform that action at this time.
0 commit comments