ssh_paramiko_backend.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:alicloud-duplicity 作者: aliyun 项目源码 文件源码
def gethostconfig(self, file, host):
        import paramiko

        file = os.path.expanduser(file)
        if not os.path.isfile(file):
            return {}

        sshconfig = paramiko.SSHConfig()
        try:
            sshconfig.parse(open(file))
        except Exception as e:
            raise BackendException("could not load '%s', maybe corrupt?" % (file))

        return sshconfig.lookup(host)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号