summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-02-08 14:54:41 +0000
committerGerrit Code Review <review@openstack.org>2017-02-08 14:54:41 +0000
commit7d7d71ee2439098ce79869e5c44411697697a371 (patch)
tree3018b18ef2b50d876db9929bfbc6a315a05f9dba
parent4e1577f4bec8555190f8f3ff5304f3c8c586e44e (diff)
parentb595890f980ae28ff1c6d18baf3c6febf5f11c48 (diff)
Merge "Use the oslo_utils address parser" into stable/newton3.0.1
-rw-r--r--designate/service.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/designate/service.py b/designate/service.py
index 1515d4f..e5431f1 100644
--- a/designate/service.py
+++ b/designate/service.py
@@ -30,6 +30,7 @@ from oslo_config import cfg
30from oslo_log import log as logging 30from oslo_log import log as logging
31from oslo_service import service 31from oslo_service import service
32from oslo_service import sslutils 32from oslo_service import sslutils
33from oslo_utils import netutils
33 34
34from designate.i18n import _ 35from designate.i18n import _
35from designate.i18n import _LE 36from designate.i18n import _LE
@@ -123,17 +124,11 @@ class Service(service.Service):
123 return [(host, port)] 124 return [(host, port)]
124 125
125 else: 126 else:
126 def _split_host_port(l): 127
127 try: 128 return map(
128 host, port = l.split(':', 1) 129 netutils.parse_host_port,
129 return host, int(port) 130 set(self._service_config.listen)
130 except ValueError: 131 )
131 LOG.exception(_LE('Invalid ip:port pair: %s'), l)
132 raise
133
134 # Convert listen pair list to a set, to remove accidental
135 # duplicates.
136 return map(_split_host_port, set(self._service_config.listen))
137 132
138 133
139class RPCService(object): 134class RPCService(object):