def ssh_config(host_string=None):
 from fabric.state import env
 dummy = {}
 if (not env.use_ssh_config):
  return dummy
 if ('_ssh_config' not in env):
  try:
   conf = ssh.SSHConfig()
   path = os.path.expanduser(env.ssh_config_path)
   with open(path) as fd:
    conf.parse(fd)
    env._ssh_config = conf
  except IOError:
   warn(("Unable to load SSH config file '%s'" % path))
   return dummy
 host = parse_host_string((host_string or env.host_string))['host']
 return env._ssh_config.lookup(host)

def ssh_config ( host_string = None ) : from fabric . state import env dummy = { } if ( not env . use_ssh_config ) : return dummy if ( '_ssh_config' not in env ) : try : conf = ssh . SSHConfig ( ) path = os . path . expanduser ( env . ssh_config_path ) with open ( path ) as fd : conf . parse ( fd ) env . _ssh_config = conf except IOError : warn ( ( "Unable to load SSH config file '%s'" % path ) ) return dummy host = parse_host_string ( ( host_string or env . host_string ) ) [ 'host' ] return env . _ssh_config . lookup ( host )
return ssh configuration dict for current env .