Commit 54ab6aec authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

SshRunner.Run: Pass all arguments to BuildCmd

This patch changes SshRunner.Run to pass all arguments to
SshRunner.BuildCmd. They had the same arguments before
and should stay that way. This change makes it easier
to add new or change existing arguments.

Reviewed-by: ultrotter
parent c85d3b64
......@@ -133,28 +133,20 @@ class SshRunner:
argv.extend(["%s@%s" % (user, hostname), command])
return argv
def Run(self, hostname, user, command, batch=True, ask_key=False,
def Run(self, *args, **kwargs):
"""Runs a command on a remote node.
This method has the same return value as `utils.RunCmd()`, which it
uses to launch ssh.
hostname: the target host, string
user: user to auth as
command: the command
batch: if true, ssh will run in batch mode with no prompting
ask_key: if true, ssh will run with StrictHostKeyChecking=ask, so that
we can connect to an unknown host (not valid in batch mode)
See SshRunner.BuildCmd.
`utils.RunResult` like `utils.RunCmd()`
return utils.RunCmd(self.BuildCmd(hostname, user, command, batch=batch,
return utils.RunCmd(self.BuildCmd(*args, **kwargs))
def CopyFileToNode(self, node, filename):
"""Copy a file to another node with scp.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment