remote.py 文件源码

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

项目:runcommands 作者: wylee 项目源码 文件源码
def get_client(cls, host, user, debug=False):
        key = (host, user)
        if key not in cls.clients:
            client = SSHClient()
            client.load_system_host_keys()
            client.set_missing_host_key_policy(AutoAddPolicy())
            client.connect(host, username=user)
            cls.clients[key] = client
            if debug:
                printer.debug('Created SSH connection for {user}@{host}'.format_map(locals()))
        else:
            printer.debug('Using existing SSH connection for {user}@{host}'.format_map(locals()))
        return cls.clients[key]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号