From 54ab6aec113891f05b65274262b9116e314a2dc9 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Fri, 15 Aug 2008 08:44:11 +0000 Subject: [PATCH] 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 --- lib/ssh.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/ssh.py b/lib/ssh.py index 366426a0d..d297c09ce 100644 --- a/lib/ssh.py +++ b/lib/ssh.py @@ -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, - use_cluster_key=True): + 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. Args: - 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. Returns: `utils.RunResult` like `utils.RunCmd()` """ - return utils.RunCmd(self.BuildCmd(hostname, user, command, batch=batch, - ask_key=ask_key, - use_cluster_key=use_cluster_key)) + return utils.RunCmd(self.BuildCmd(*args, **kwargs)) def CopyFileToNode(self, node, filename): """Copy a file to another node with scp. -- GitLab