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)
评论列表
文章目录