bootstrap.RunNodeSetupCmd: Add IPv6 support
authorMichael Hanselmann <hansmi@google.com>
Fri, 30 Nov 2012 10:36:40 +0000 (11:36 +0100)
committerMichael Hanselmann <hansmi@google.com>
Mon, 3 Dec 2012 13:04:24 +0000 (14:04 +0100)
Commit 224ff0f modified the node SSH setup to use the system's SSH
client. Before that Paramiko was used. It's not entirely clear whehter
the latter ever supported IPv6 properly, but with this patch
“bootstrap.RunNodeSetupCmd” is changed to use it if configured. The code
for doing so is taken from “bootstrap.SetupNodeDaemon”, which is going
to use “bootstrap.RunNodeSetupCmd”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

lib/bootstrap.py

index f909299..6ebb7c8 100644 (file)
@@ -288,7 +288,9 @@ def RunNodeSetupCmd(cluster_name, node, basecmd, debug, verbose,
   if verbose:
     cmd.append("--verbose")
 
-  srun = ssh.SshRunner(cluster_name)
+  family = ssconf.SimpleStore().GetPrimaryIPFamily()
+  srun = ssh.SshRunner(cluster_name,
+                       ipv6=(family == netutils.IP6Address.family))
   scmd = srun.BuildCmd(node, constants.SSH_LOGIN_USER,
                        utils.ShellQuoteArgs(cmd),
                        batch=False, ask_key=ask_key, quiet=False,