IPv6 fixes
This patch makes validate_ssh works for IPv6 addresses.Also file transport via scp has been fixed to work via IPv6 address Change-Id: I55c88d3fcaaa8decd647aa38404ac653d5f5dbba
This commit is contained in:
@@ -138,7 +138,7 @@ def validate_ip(param, options=None):
|
||||
for family in (socket.AF_INET, socket.AF_INET6):
|
||||
try:
|
||||
socket.inet_pton(family, param)
|
||||
break
|
||||
return family
|
||||
except socket.error:
|
||||
continue
|
||||
else:
|
||||
@@ -213,7 +213,7 @@ def touch_port(host, port):
|
||||
key = "%s:%d" % (host, port)
|
||||
if key in _tested_ports:
|
||||
return
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s = socket.socket(validate_ip(host), socket.SOCK_STREAM)
|
||||
s.connect((host, port))
|
||||
s.shutdown(socket.SHUT_RDWR)
|
||||
s.close()
|
||||
|
@@ -85,7 +85,7 @@ def wait_for_puppet(currently_running, messages):
|
||||
log = log.replace(".finished", ".log")
|
||||
local_server.append('scp -o StrictHostKeyChecking=no '
|
||||
'-o UserKnownHostsFile=/dev/null '
|
||||
'root@%s:%s %s'
|
||||
'root@[%s]:%s %s'
|
||||
% (hostname, finished_logfile, log))
|
||||
# To not pollute logs we turn of logging of command execution
|
||||
local_server.execute(log=False)
|
||||
@@ -209,7 +209,7 @@ def copy_puppet_modules(config, messages):
|
||||
for path, localname in resources.get(hostname, []):
|
||||
server.append("scp -o StrictHostKeyChecking=no "
|
||||
"-o UserKnownHostsFile=/dev/null "
|
||||
"%s root@%s:%s/resources/%s" %
|
||||
"%s root@[%s]:%s/resources/%s" %
|
||||
(path, hostname, host_dir, localname))
|
||||
|
||||
# copy Puppet modules required by Packstack
|
||||
|
Reference in New Issue
Block a user