From e830c9622072e1bade7a8cc1e863b99a4ea75a61 Mon Sep 17 00:00:00 2001 From: Amit Siddhu Date: Mon, 13 Feb 2017 15:09:57 +0530 Subject: [PATCH] adding/using host_port property fixes #648 --- lib/disco/util.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/disco/util.py b/lib/disco/util.py index 540cbb7b0..e5a274516 100644 --- a/lib/disco/util.py +++ b/lib/disco/util.py @@ -32,6 +32,10 @@ def host(self): def port(self): return self[1] + @property + def host_port(self): + return self[0], self[1] + def __nonzero__(host_port): return bool(host_port[0]) @@ -169,7 +173,7 @@ def urlsplit(url, localhost=None, disco_port=None, **kwargs): path, locstr = locstr, '' else: disco_port = disco_port or str(DiscoSettings()['DISCO_PORT']) - host, port = netloc.parse(locstr) + host, port = netloc.parse(locstr).host_port if scheme == 'disco' or port == disco_port: if localhost == True or locstr == localhost: scheme = 'file'