ssh.py 文件源码

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

项目:aegea 作者: kislyuk 项目源码 文件源码
def check_output(self, command, input_data=None, stderr=sys.stderr):
        logger.debug('Running "%s"', command)
        ssh_stdin, ssh_stdout, ssh_stderr = self.exec_command(command)
        if input_data is not None:
            ssh_stdin.write(input_data)
        exit_code = ssh_stdout.channel.recv_exit_status()
        stderr.write(ssh_stderr.read().decode("utf-8"))
        if exit_code != os.EX_OK:
            raise Exception('Error while running "{}": {}'.format(command, os.errno.errorcode.get(exit_code)))
        return ssh_stdout.read().decode("utf-8")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号