summaryrefslogtreecommitdiff
path: root/keystoneclient/service_catalog.py
diff options
context:
space:
mode:
authorBrant Knudson <bknudson@us.ibm.com>2015-07-26 07:28:28 -0500
committerBrant Knudson <bknudson@us.ibm.com>2015-08-13 18:58:27 -0500
commit0d293eaf4413f82f55e3b13062b2bc710a6f3935 (patch)
tree5f4de45140c982d5809c1c58a3ddcc1b879134c9 /keystoneclient/service_catalog.py
parent803eb235d50daad27074198effc98ca536f1550f (diff)
downloadpython-keystoneclient-0d293eaf4413f82f55e3b13062b2bc710a6f3935.tar.gz
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
Diffstat (limited to 'keystoneclient/service_catalog.py')
-rw-r--r--keystoneclient/service_catalog.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/keystoneclient/service_catalog.py b/keystoneclient/service_catalog.py
index b8f4ec2..bb64689 100644
--- a/keystoneclient/service_catalog.py
+++ b/keystoneclient/service_catalog.py
@@ -191,10 +191,13 @@ class ServiceCatalog(object):
except KeyError:
return
- # TODO(jamielennox): at least swiftclient is known to set attr and not
- # filter_value and expects that to mean that filtering is ignored, so
- # we can't check for the presence of attr. This behaviour should be
- # deprecated and an appropriate warning provided.
+ if attr and not filter_value:
+ warnings.warn(
+ 'Providing attr without filter_value to get_urls() is '
+ '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:
return [endpoint for endpoint in endpoints
if endpoint.get(attr) == filter_value]