shell.py 文件源码

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

项目:docker-zenoss4 作者: krull 项目源码 文件源码
def run_command(self, command_line):
        """
        Run commands in a remote shell like the winrs application on Windows.
        Accepts multiple commands. Returns a dictionary with the following
        structure:
            CommandResponse
                .stdout = [<non-empty, stripped line>, ...]
                .stderr = [<non-empty, stripped line>, ...]
                .exit_code = <int>
        """
        shell_id = yield self._create_shell()
        try:
            cmd_response = yield self._run_command(shell_id, command_line)
        except TimeoutError:
            yield self._sender.close_connections()
        yield self._delete_shell(shell_id)
        yield self._sender.close_connections()
        defer.returnValue(cmd_response)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号