def _get_ssh_config(config_path='~/.ssh/config'):
"""Extract the configuration located at ``config_path``.
Returns:
paramiko.SSHConfig: the configuration instance.
"""
ssh_config = paramiko.SSHConfig()
try:
with open(os.path.realpath(os.path.expanduser(config_path))) as f:
ssh_config.parse(f)
except IOError:
pass
return ssh_config
评论列表
文章目录