def run(self, command):
"""
Runs a command over SSH on the client.
command -- the command to execute.
Return a tuple of the stdin, stdout, and stderr of the executing command,
as a 3-tuple.
"""
(ins, out, err) = self.client.exec_command(command)
if self.use_log:
with open("Skynet.log", 'a') as file:
file.write("executing command: %s\n" % command)
file.write("%s\n" % out.read().decode('utf-8'))
file.write("%s\n" % err.read().decode('utf-8'))
file.write("Exit status: %i\n\n" % out.channel.recv_exit_status())
return (ins, out, err)
评论列表
文章目录