MCPcopy Create free account
hub / github.com/apache/cloudstack / execute

Method execute

tools/marvin/marvin/sshClient.py:83–98  ·  view source on GitHub ↗
(self, command)

Source from the content-addressed store, hash-verified

81 raise internalError("SSH Connection Failed")
82
83 def execute(self, command):
84 stdin, stdout, stderr = self.ssh.exec_command(command)
85 output = stdout.readlines()
86 errors = stderr.readlines()
87 results = []
88 if output is not None and len(output) == 0:
89 if errors is not None and len(errors) > 0:
90 for error in errors:
91 results.append(error.rstrip())
92
93 else:
94 for strOut in output:
95 results.append(strOut.rstrip())
96 self.logger.debug("{Cmd: %s via Host: %s} {returns: %s}" %
97 (command, str(self.host), results))
98 return results
99
100 def createConnection(self):
101 '''

Callers 15

test_DeployVmMethod · 0.95
get_process_statusFunction · 0.95
_execute_ssh_commandFunction · 0.95
is_snapshot_on_nfsFunction · 0.95
createChecksumFunction · 0.95
compareChecksumFunction · 0.95

Calls 4

exec_commandMethod · 0.80
readlinesMethod · 0.80
debugMethod · 0.80
appendMethod · 0.45