Merge PR #34180 into master

* refs/pull/34180/head:
	cephadm: Fix check_ip_port to work with IPv6

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2020-03-25 16:42:42 -05:00
commit b2aede193e

View File

@ -366,6 +366,8 @@ def check_ip_port(ip, port):
logger.info('Verifying IP %s port %d ...' % (ip, port))
if ip.startswith('[') or '::' in ip:
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
if ip.startswith('[') and ip.endswith(']'):
ip = ip[1:-1]
else:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try: