Skip to content

Commit b9ee2d1

Browse files
author
jdkandersson
committed
add support for ipv6
1 parent c4c302e commit b9ee2d1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

juju/client/connection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,9 @@ def https_connection(self):
678678
679679
"""
680680
endpoint = self.endpoint
681-
host, remainder = endpoint.split(':', 1)
681+
# Support IPv6 by right splitting on : and removing [] around IP address for host
682+
host, remainder = endpoint.rsplit(':', 1)
683+
host = host.strip("[]")
682684
port = remainder
683685
if '/' in remainder:
684686
port, _ = remainder.split('/', 1)

0 commit comments

Comments
 (0)