Commit 07ff0a78 authored by Andrea Spadaccini's avatar Andrea Spadaccini Committed by Guido Trotter
Browse files

Allow retrying commands in cluster-merge


Signed-off-by: default avatarAndrea Spadaccini <spadaccio@google.com>
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent cc2cccfc
......@@ -217,17 +217,22 @@ class Merger(object):
def _RunCmd(self, hostname, command, user="root", use_cluster_key=False,
strict_host_check=False, private_key=None, batch=True,
ask_key=False):
ask_key=False, max_attempts=1):
"""Wrapping SshRunner.Run with default parameters.
For explanation of parameters see L{ganeti.ssh.SshRunner.Run}.
"""
return self.ssh_runner.Run(hostname=hostname, command=command, user=user,
use_cluster_key=use_cluster_key,
strict_host_check=strict_host_check,
private_key=private_key, batch=batch,
ask_key=ask_key)
for _ in range(max_attempts):
result = self.ssh_runner.Run(hostname=hostname, command=command,
user=user, use_cluster_key=use_cluster_key,
strict_host_check=strict_host_check,
private_key=private_key, batch=batch,
ask_key=ask_key)
if not result.failed:
break
return result
def _StopMergingInstances(self):
"""Stop instances on merging clusters.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment