Binding can be missing in config

This commit is contained in:
Roland Hedberg
2010-10-13 13:39:53 +02:00
parent 74494d8d08
commit 09fc7c6752

View File

@@ -156,11 +156,12 @@ class Config(dict):
specified the default binding for that service is searched for.
:return: Possible empty list of endpoints
"""
try:
res = []
for spec in self["service"][typ]["endpoints"][service]:
if isinstance(spec, basestring):
if binding == None:
if binding == None or binding == DEFAULT_BINDING[service]:
res.append(spec)
elif isinstance(spec, tuple):
if binding == spec[1]: