Very simple scenario:
env.use_ssh_config = True
@hosts(['example'])
def test():
run('uname')
and with the following SSH config:
Host example
HostName example.com
I'm getting this:
$ fab test
[example] Executing task 'test'
[example] run: uname
Fatal error: Name lookup failed for example.com
Underlying exception:
nodename nor servname provided, or not known
Aborting.
# BUT!
$ ssh example uname
Linux
Any idea what's going on?
I just found out I had HostName example.com_ (underscore is an accidental trailing whitespace) in the SSH config.
Looks like #305 all over again?
I think this needs to be done on the ssh side since the actual matching of input (Fabric asking for host "example") with the ssh config key, which is what needs stripping ("example ") is performed in SSHConfig.lookup. I'll make a reference there.
See ssh #23
Thanks @yuvadm - extra space got me too
Got bitten by the extra whitespace bug too, posting this here for future searchers:
The error I was getting was Fatal error: Name lookup failed for hosts - since we were using the dictionary-based env.roledefs definition.
Most helpful comment
Got bitten by the extra whitespace bug too, posting this here for future searchers:
The error I was getting was
Fatal error: Name lookup failed for hosts- since we were using the dictionary-basedenv.roledefsdefinition.