This function used a hand-coded ssh call to remote nodes. Fix it to use the
ssh.SSHCall function, and in the process drop the command field from the
results, as it's too verbose and we can use (in gnt-cluster) what we passed in.
Reviewed-by: schreiberal
"""
data = []
for node in self.nodes:
- result = utils.RunCmd(["ssh", node.name, self.op.command])
- data.append((node.name, result.cmd, result.output, result.exit_code))
+ result = ssh.SSHCall(node.name, "root", self.op.command)
+ data.append((node.name, result.output, result.exit_code))
return data
nodes = opts.nodes
op = opcodes.OpRunClusterCommand(command=command, nodes=nodes)
result = SubmitOpCode(op)
- for node, sshcommand, output, exit_code in result:
+ for node, output, exit_code in result:
print ("------------------------------------------------")
print ("node: %s" % node)
- print ("command: %s" % sshcommand)
print ("%s" % output)
print ("return code = %s" % exit_code)