From c14ed896c3edc910037cb9765881005a3d3683b2 Mon Sep 17 00:00:00 2001 From: Ivan Devat Date: Fri, 24 May 2019 09:26:04 +0200 Subject: [PATCH] fix communication over IPv6 --- pcs/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pcs/utils.py b/pcs/utils.py index aa45e0dc..fd29e2fd 100644 --- a/pcs/utils.py +++ b/pcs/utils.py @@ -476,8 +476,10 @@ def sendHTTPRequest( token = known_host.token if port is None: port = settings.pcsd_default_port - url = "https://{addr}:{port}/{request}".format( - addr=addr, request=request, port=port + url = "https://{host}:{port}/{request}".format( + host="[{0}]".format(addr) if ":" in addr else addr, + request=request, + port=port ) if "--debug" in pcs_options: print("Sending HTTP Request to: " + url) -- 2.21.0