cmdshell.py 文件源码

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

项目:Chromium_DepotTools 作者: p07r0457 项目源码 文件源码
def run(self, command):
        """
        Execute a command on the remote host.  Return a tuple containing
        an integer status and a two strings, the first containing stdout
        and the second containing stderr from the command.
        """
        boto.log.debug('running:%s on %s' % (command, self.server.instance_id))
        status = 0
        try:
            t = self._ssh_client.exec_command(command)
        except paramiko.SSHException:
            status = 1
        std_out = t[1].read()
        std_err = t[2].read()
        t[0].close()
        t[1].close()
        t[2].close()
        boto.log.debug('stdout: %s' % std_out)
        boto.log.debug('stderr: %s' % std_err)
        return (status, std_out, std_err)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号