ssh.py 文件源码

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

项目:deb-python-hplefthandclient 作者: openstack 项目源码 文件源码
def open(self):
        """Opens a new SSH connection if the transport layer is missing.

        This can be called if an active SSH connection is open already.

        """
        # Create a new SSH connection if the transport layer is missing.
        if self.ssh:
            transport_active = False
            if self.ssh.get_transport():
                transport_active = self.ssh.get_transport().is_active()
            if not transport_active:
                try:
                    self._connect(self.ssh)
                except Exception as e:
                    msg = "Error connecting via ssh: %s" % e
                    self._logger.error(msg)
                    raise paramiko.SSHException(msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号