[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.51

Andreas Beckmann anbe at debian.org
Wed May 15 10:09:30 UTC 2013


The following commit has been merged in the master branch:
commit 545e997237067f7fc70e28984e8c09906983737f
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sun Mar 17 08:55:30 2013 +0100

    p-s: simplify ssh command generation
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>

diff --git a/piuparts-slave.py b/piuparts-slave.py
index ab00f29..e759295 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -202,15 +202,15 @@ class Slave:
 
     def connect_to_master(self, log_file):
         logging.info("Connecting to %s" % self._master_host)
+        ssh_command = ["ssh", "-x"]
         if self._master_user:
-            user = self._master_user + "@"
-        else:
-            user = ""
+            ssh_command.extend(["-l", self._master_user])
+        ssh_command.append(self._master_host)
         ssh_cmdline = "cd %s; %s %s 2> %s.$$ && rm %s.$$" % \
                       (self._master_directory or ".",
                       self._master_command, self._section, log_file, log_file)
-        p = subprocess.Popen(["ssh", "-x", user + self._master_host, ssh_cmdline],
-                       stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+        ssh_command.append(ssh_cmdline)
+        p = subprocess.Popen(ssh_command, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
         self._to_master = p.stdin
         self._from_master = p.stdout
         line = self._readline()

-- 
piuparts git repository



More information about the Piuparts-commits mailing list