Instead of using an parameter which isn't beeing set everywhere
Fixing issue #892
Signed-off-by: Neal Oakey <
neal....@googlemail.com>
---
lib/bootstrap.py | 5 ++---
lib/ssh.py | 8 ++++----
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/lib/bootstrap.py b/lib/bootstrap.py
index 96627e2..99aa7c1 100644
--- a/lib/bootstrap.py
+++ b/lib/bootstrap.py
@@ -344,9 +344,7 @@ def RunNodeSetupCmd(cluster_name, node, basecmd, debug, verbose,
if port is None:
port = netutils.GetDaemonPort(constants.SSH)
- family = ssconf.SimpleStore().GetPrimaryIPFamily()
- srun = ssh.SshRunner(cluster_name,
- ipv6=(family == netutils.IP6Address.family))
+ srun = ssh.SshRunner(cluster_name)
scmd = srun.BuildCmd(node, constants.SSH_LOGIN_USER,
utils.ShellQuoteArgs(
utils.ShellCombineCommands(all_cmds)),
@@ -368,6 +366,7 @@ def RunNodeSetupCmd(cluster_name, node, basecmd, debug, verbose,
raise errors.OpExecError("Command '%s' failed: %s" %
(result.cmd, result.fail_reason))
+ family = ssconf.SimpleStore().GetPrimaryIPFamily()
_WaitForSshDaemon(node, port, family)
diff --git a/lib/ssh.py b/lib/ssh.py
index af64f3e..599b7cc 100644
--- a/lib/ssh.py
+++ b/lib/ssh.py
@@ -43,6 +43,7 @@ from ganeti import netutils
from ganeti import pathutils
from ganeti import vcluster
from ganeti import compat
+from ganeti import ssconf
def GetUserFiles(user, mkdir=False, dircheck=True, kind=constants.SSHK_DSA,
@@ -119,17 +120,16 @@ class SshRunner(object):
"""Wrapper for SSH commands.
"""
- def __init__(self, cluster_name, ipv6=False):
+ def __init__(self, cluster_name):
"""Initializes this class.
@type cluster_name: str
@param cluster_name: name of the cluster
- @type ipv6: bool
- @param ipv6: If true, force ssh to use IPv6 addresses only
"""
self.cluster_name = cluster_name
- self.ipv6 = ipv6
+ family = ssconf.SimpleStore().GetPrimaryIPFamily()
+ self.ipv6 = (family == netutils.IP6Address.family)
def _BuildSshOptions(self, batch, ask_key, use_cluster_key,
strict_host_check, private_key=None, quiet=True,
--
1.7.10.4