Proxycommand 'none' interpreted as command #415
With regards to ssh config, the proxycommand is disabled by specifing 'none':
Relevant section taken from ssh_config man pages:
I have a slightly complicated ssh_config, which has to explicitly disable proxy command for some hosts due to how hostname matching has been implemented.
However, when using fabric and/or paramiko, the "none" option gets interrupted as an actual string value, which results in no fabric commands working as it throws exceptions containing OSError: [Errno 2] No such file or directory
A test script showing the parsing behaviour is below:
#!/usr/bin/python import paramiko import StringIO temp_config = ''' Host 22.214.171.124 User guestuser StrictHostKeyChecking no UserKnownHostsFile /dev/null ProxyCommand none ''' fake_config_file = StringIO.StringIO() fake_config_file.write(temp_config) fake_config_file.seek(0) ssh_config = paramiko.SSHConfig() ssh_config.parse(fake_config_file) print ssh_config.lookup('126.96.36.199')
This is eventually used in fabric in fabric/network.py:
def get_gateway(host, port, cache, replace=False): ... proxy_command = ssh_config().get('proxycommand', None) ... elif proxy_command: sock = ssh.ProxyCommand(proxy_command) return sock
While this could be fixed by simply checking for 'none' in fabric, I've opened an issue here against paramiko as I believe it makes more sense to fix it at this level. Please feel free to disagree and I'll report it against fabric instead if desired.
The text was updated successfully, but these errors were encountered: