diff options
author | Graham Hayes <graham.hayes@hpe.com> | 2017-01-18 15:22:38 +0000 |
---|---|---|
committer | Graham Hayes <graham.hayes@hpe.com> | 2017-01-30 00:25:51 +0000 |
commit | b595890f980ae28ff1c6d18baf3c6febf5f11c48 (patch) | |
tree | 75ac9937423c5765d5bbe71b0159d5a832cdb448 | |
parent | c0c599b2f5ea861f515e82ec8b1dad30c11e2575 (diff) | |
download | designate-b595890f980ae28ff1c6d18baf3c6febf5f11c48.tar.gz |
Use the oslo_utils address parser
Ours did not understand IPv6
Change-Id: I4c15909ed22c64fde4a64eb612d52ddcca247f43
Fixes-Bug: #1653839
(cherry picked from commit 184544ec6c155578192f69edcb02d74799e6cbe0)
-rw-r--r-- | designate/service.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/designate/service.py b/designate/service.py index 1515d4f5..e5431f1a 100644 --- a/designate/service.py +++ b/designate/service.py @@ -30,6 +30,7 @@ from oslo_config import cfg from oslo_log import log as logging from oslo_service import service from oslo_service import sslutils +from oslo_utils import netutils from designate.i18n import _ from designate.i18n import _LE @@ -123,17 +124,11 @@ class Service(service.Service): return [(host, port)] else: - def _split_host_port(l): - try: - host, port = l.split(':', 1) - return host, int(port) - except ValueError: - LOG.exception(_LE('Invalid ip:port pair: %s'), l) - raise - - # Convert listen pair list to a set, to remove accidental - # duplicates. - return map(_split_host_port, set(self._service_config.listen)) + + return map( + netutils.parse_host_port, + set(self._service_config.listen) + ) class RPCService(object): |