Skip to content

Instantly share code, notes, and snippets.

@yosshy
Last active July 30, 2019 04:23
Show Gist options
  • Save yosshy/908f324eee410bdfe38d8b8b87f90113 to your computer and use it in GitHub Desktop.
Save yosshy/908f324eee410bdfe38d8b8b87f90113 to your computer and use it in GitHub Desktop.
Fix IPv6 config in Monasca APIs
diff --git a/monasca_api/conf/types.py b/monasca_api/conf/types.py
index 5edc56b..a5180e4 100644
--- a/monasca_api/conf/types.py
+++ b/monasca_api/conf/types.py
@@ -36,7 +36,7 @@ class HostAddressPortType(types.HostAddress):
super(HostAddressPortType, self).__init__(version, type_name=type_name)
def __call__(self, value):
- addr, port = value.split(':')
+ addr, port = value.rsplit(':', 1)
addr = self.validate_addr(addr)
port = self._validate_port(port)
if not addr and not port:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment