Don't ip_bracket addresses returned by check_dns.

This ends up in opts['master_ip'] where it can cause problems. I found
this while testng a git+pip based minion installation on Ubuntu Bionic.
I'm not sure why it doesn't affect other targeted OS versions in the
test framework. On Bionic, if 'salt' resolves to an IPv6 address,
zmq fails to connect to the master, and complains about the bracketed
address.
This commit is contained in:
Jeremy McMillan 2019-01-10 12:37:14 -06:00 committed by Pedro Algarvio
parent 02b825ec3c
commit 24bb94fb9e

View file

@ -1886,14 +1886,14 @@ def dns_check(addr, port, safe=False, ipv6=None):
if h[0] == socket.AF_INET6 and ipv6 is False:
continue
candidate_addr = salt.utils.zeromq.ip_bracket(h[4][0])
candidate_addr = h[4][0]
if h[0] != socket.AF_INET6 or ipv6 is not None:
candidates.append(candidate_addr)
try:
s = socket.socket(h[0], socket.SOCK_STREAM)
s.connect((candidate_addr.strip('[]'), port))
s.connect((candidate_addr), port))
s.close()
resolved = candidate_addr