Deprecate ServiceCatalog.get_urls() with no attr
There was a TODO to deprecate calling ServiceCatalog.get_urls() with an attr but no filter_value. bp deprecations Change-Id: Idd97ce6920d63e1abb4f10ba4965035ba40f0155
This commit is contained in:
@@ -191,10 +191,13 @@ class ServiceCatalog(object):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
return
|
return
|
||||||
|
|
||||||
# TODO(jamielennox): at least swiftclient is known to set attr and not
|
if attr and not filter_value:
|
||||||
# filter_value and expects that to mean that filtering is ignored, so
|
warnings.warn(
|
||||||
# we can't check for the presence of attr. This behaviour should be
|
'Providing attr without filter_value to get_urls() is '
|
||||||
# deprecated and an appropriate warning provided.
|
'deprecated as of the 1.7.0 release and may be removed in the '
|
||||||
|
'2.0.0 release. Either both should be provided or neither '
|
||||||
|
'should be provided.')
|
||||||
|
|
||||||
if filter_value:
|
if filter_value:
|
||||||
return [endpoint for endpoint in endpoints
|
return [endpoint for endpoint in endpoints
|
||||||
if endpoint.get(attr) == filter_value]
|
if endpoint.get(attr) == filter_value]
|
||||||
|
Reference in New Issue
Block a user