Support [ipv6]:port format

This commit is contained in:
jesopo 2019-02-22 17:00:46 +00:00 committed by Valentin Lorentz
parent c87aacb690
commit 61d9596d35

View File

@ -256,6 +256,11 @@ class Servers(registry.SpaceSeparatedListOfStrings):
def convert(self, s): def convert(self, s):
s = self.normalize(s) s = self.normalize(s)
(server, port) = s.rsplit(':', 1) (server, port) = s.rsplit(':', 1)
# support for `[ipv6]:port` format
if server.startwith("[") and server.endswith("]"):
server = server[1:-1]
port = int(port) port = int(port)
return (server, port) return (server, port)