diff --git a/management/status_checks.py b/management/status_checks.py index d2f125eb7..c4cd4a0b0 100755 --- a/management/status_checks.py +++ b/management/status_checks.py @@ -168,12 +168,14 @@ def check_ssh_running_extended(def_port, name): # Check each address, and work with the first one found for la in listenaddresses: - ipaddr, port = parse_listenaddress(la) - + ipaddr, port, t = parse_listenaddress(la) + if not ipaddr: continue - if not port: + if port: + port = int(port) + else: port = def_port if try_connect(ipaddr, port): diff --git a/management/utils.py b/management/utils.py index 0c9db7db1..1d48d7b3a 100644 --- a/management/utils.py +++ b/management/utils.py @@ -228,8 +228,13 @@ def parse_listenaddress(la_str): if rightpos >= 0: ip = la_str[leftpos:rightpos] - if len(la_str) > rightpos + 1: - port = la_str[rightpos + 1:] + if iptype == 4: + rightpos += 1 + else: + rightpos += 2 + + if len(la_str) > rightpos: + port = la_str[rightpos:] return ip, port, iptype