Commit 8062638d authored by Manuel Franceschini's avatar Manuel Franceschini
Browse files

Fix scp command when target is an IPv6 address

Due to the syntax used for the target in scp <target>:<path>, it is
necessary when the target is an IPv6 address to enclose it in square
Signed-off-by: default avatarManuel Franceschini <>
Reviewed-by: default avatarIustin Pop <>
parent 338180f5
......@@ -31,6 +31,7 @@ import re
from ganeti import utils
from ganeti import errors
from ganeti import constants
from ganeti import netutils
def FormatParamikoFingerprint(fingerprint):
......@@ -220,6 +221,9 @@ class SshRunner:
command = [constants.SCP, "-p"]
command.extend(self._BuildSshOptions(True, False, True, True))
if netutils.IP6Address.IsValid(node):
node = netutils.FormatAddress((node, None))
command.append("%s:%s" % (node, filename))
result = utils.RunCmd(command)
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