An all-purpose API in case the command to be executed is already OS-agnostic, such as when the path to the executed command has been constructed beforehand.
(
self,
command: str,
timeout: float = SETTINGS.timeout,
privileged: bool = False,
verify: bool = False,
env: dict | None = None,
)
| 65 | return self.remote_session.is_alive() |
| 66 | |
| 67 | def send_command( |
| 68 | self, |
| 69 | command: str, |
| 70 | timeout: float = SETTINGS.timeout, |
| 71 | privileged: bool = False, |
| 72 | verify: bool = False, |
| 73 | env: dict | None = None, |
| 74 | ) -> CommandResult: |
| 75 | """ |
| 76 | An all-purpose API in case the command to be executed is already |
| 77 | OS-agnostic, such as when the path to the executed command has been |
| 78 | constructed beforehand. |
| 79 | """ |
| 80 | if privileged: |
| 81 | command = self._get_privileged_command(command) |
| 82 | |
| 83 | return self.remote_session.send_command(command, timeout, verify, env) |
| 84 | |
| 85 | def create_interactive_shell( |
| 86 | self, |