MCPcopy Create free account
hub / github.com/StackStorm/st2 / _run_command

Method _run_command

st2common/st2common/runners/parallel_ssh.py:301–317  ·  view source on GitHub ↗
(self, host, cmd, results, timeout=None)

Source from the content-addressed store, hash-verified

299 results[hostname] = {"message": "Connected to host."}
300
301 def _run_command(self, host, cmd, results, timeout=None):
302 try:
303 LOG.debug("Running command: %s on host: %s.", cmd, host)
304 client = self._hosts_client[host]
305 (stdout, stderr, exit_code) = client.run(
306 cmd, timeout=timeout, call_line_handler_func=True
307 )
308
309 result = self._handle_command_result(
310 stdout=stdout, stderr=stderr, exit_code=exit_code
311 )
312 results[host] = result
313 except Exception as ex:
314 cmd = self._sanitize_command_string(cmd=cmd)
315 error = 'Failed executing command "%s" on host "%s"' % (cmd, host)
316 LOG.exception(error)
317 results[host] = self._generate_error_result(exc=ex, message=error)
318
319 def _put_files(
320 self, local_path, remote_path, host, results, mode=None, mirror_local_mode=False

Callers

nothing calls this directly

Calls 4

runMethod · 0.45

Tested by

no test coverage detected