MCPcopy Index your code
hub / github.com/saltstack/salt / exec_cmd

Method exec_cmd

salt/client/ssh/shell.py:336–352  ·  view source on GitHub ↗

Execute a remote command

(self, cmd)

Source from the content-addressed store, hash-verified

334 yield "".join(r_out), "".join(r_err), rcode
335
336 def exec_cmd(self, cmd):
337 """
338 Execute a remote command
339 """
340 cmd = self._cmd_str(cmd)
341
342 logmsg = f"Executing command: {cmd}"
343 if self.passwd:
344 logmsg = logmsg.replace(self.passwd, ("*" * 6))
345 if 'decode("base64")' in logmsg or "base64.b64decode(" in logmsg:
346 log.debug("Executed SHIM command. Command logged to TRACE")
347 log.trace(logmsg)
348 else:
349 log.debug(logmsg)
350
351 ret = self._run_cmd(cmd)
352 return ret
353
354 def send(self, local, remote, makedirs=False):
355 """

Calls 4

_cmd_strMethod · 0.95
_run_cmdMethod · 0.95
debugMethod · 0.80
traceMethod · 0.80