From fff33d7011b8dd0edb37a7c1018fc7f7805ffeb2 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Tue, 18 Mar 2008 13:04:33 +0000
Subject: [PATCH] =?UTF-8?q?Use=20constants=20for=20=E2=80=9Cssh=E2=80=9D?=
 =?UTF-8?q?=20and=20=E2=80=9Cscp=E2=80=9D=20binaries=20instead=20of=20magi?=
 =?UTF-8?q?c=20values?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reviewed-by: ultrotter
---
 lib/constants.py | 2 ++
 lib/ssh.py       | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/constants.py b/lib/constants.py
index de40522b2..5ddf13c8e 100644
--- a/lib/constants.py
+++ b/lib/constants.py
@@ -146,6 +146,8 @@ SSH_HOST_DSA_PRIV = SSH_CONFIG_DIR + "ssh_host_dsa_key"
 SSH_HOST_DSA_PUB = SSH_HOST_DSA_PRIV + ".pub"
 SSH_HOST_RSA_PRIV = SSH_CONFIG_DIR + "ssh_host_rsa_key"
 SSH_HOST_RSA_PUB = SSH_HOST_RSA_PRIV + ".pub"
+SSH = "ssh"
+SCP = "scp"
 
 # reboot types
 INSTANCE_REBOOT_SOFT = "soft"
diff --git a/lib/ssh.py b/lib/ssh.py
index 6481d70fa..2b06a585f 100644
--- a/lib/ssh.py
+++ b/lib/ssh.py
@@ -116,7 +116,7 @@ class SshRunner:
       The ssh call to run 'command' on the remote host.
 
     """
-    argv = ["ssh", "-q"]
+    argv = [constants.SSH, "-q"]
     argv.extend(KNOWN_HOSTS_OPTS)
     argv.append(self._GetHostKeyAliasOption())
     if batch:
@@ -171,7 +171,7 @@ class SshRunner:
       logger.Error("file %s must be an absolute path" % (filename))
       return False
 
-    command = ["scp", "-q", "-p"]
+    command = [constants.SCP, "-q", "-p"]
     command.extend(KNOWN_HOSTS_OPTS)
     command.extend(BATCH_MODE_OPTS)
     command.append(self._GetHostKeyAliasOption())
-- 
GitLab