ssh.py 文件源码

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

项目:python-tripleo-helper 作者: redhat-openstack 项目源码 文件源码
def _get_transport_via_ip(self):
        for i in range(60):
            try:
                channel = self._client.get_transport().open_channel(
                    'direct-tcpip',
                    (self._hostname, 22),
                    (self.via_ip, 0))
            except ssh_exception.ChannelException:
                LOG.debug('%s creating the direct-tcip connections' % self.description)
                time.sleep(1)
            else:
                transport = paramiko.Transport(channel)
                transport.start_client()
                transport.auth_publickey(self._user, self._private_key)
                return transport
        raise Exception()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号