From 97585c15a62eb081cce5489bf4b91f0ee0334fcb Mon Sep 17 00:00:00 2001 From: Harini Date: Tue, 9 Aug 2016 01:40:18 +0530 Subject: [PATCH] EndpointPolicy driver doesn't inherit interface Added the driver interface 'base.EndpointPolicyDriverV8' as super class of the sql driver implementation. Removed unused methods from driver interface and added release notes. Change-Id: I198dcbda7591e0dafb1da3a72e3f32b258c0e299 Closes-Bug: #1611102 --- keystone/endpoint_policy/backends/base.py | 24 ------------------- keystone/endpoint_policy/backends/sql.py | 3 ++- ...used_methods_removed-e1348cbec9b1110a.yaml | 5 ++++ 3 files changed, 7 insertions(+), 25 deletions(-) create mode 100644 releasenotes/notes/endpoint_policy_driver_unused_methods_removed-e1348cbec9b1110a.yaml diff --git a/keystone/endpoint_policy/backends/base.py b/keystone/endpoint_policy/backends/base.py index de7d48a676..f60a86cf11 100644 --- a/keystone/endpoint_policy/backends/base.py +++ b/keystone/endpoint_policy/backends/base.py @@ -114,30 +114,6 @@ class EndpointPolicyDriverV8(object): :type policy_id: string :returns: List of association dicts - """ - raise exception.NotImplemented() # pragma: no cover - - @abc.abstractmethod - def list_endpoints_for_policy(self, policy_id): - """List all the endpoints using a given policy. - - :param policy_id: identity of policy that is being associated - :type policy_id: string - :returns: list of endpoints that have an effective association with - that policy - - """ - raise exception.NotImplemented() # pragma: no cover - - @abc.abstractmethod - def get_policy_for_endpoint(self, endpoint_id): - """Get the appropriate policy for a given endpoint. - - :param endpoint_id: identity of endpoint - :type endpoint_id: string - :returns: Policy entity for the endpoint - - """ raise exception.NotImplemented() # pragma: no cover diff --git a/keystone/endpoint_policy/backends/sql.py b/keystone/endpoint_policy/backends/sql.py index 4a00cebd61..ebf89f0579 100644 --- a/keystone/endpoint_policy/backends/sql.py +++ b/keystone/endpoint_policy/backends/sql.py @@ -17,6 +17,7 @@ import uuid import sqlalchemy from keystone.common import sql +from keystone.endpoint_policy.backends import base from keystone import exception @@ -47,7 +48,7 @@ class PolicyAssociation(sql.ModelBase, sql.ModelDictMixin): return d -class EndpointPolicy(object): +class EndpointPolicy(base.EndpointPolicyDriverV8): def create_policy_association(self, policy_id, endpoint_id=None, service_id=None, region_id=None): diff --git a/releasenotes/notes/endpoint_policy_driver_unused_methods_removed-e1348cbec9b1110a.yaml b/releasenotes/notes/endpoint_policy_driver_unused_methods_removed-e1348cbec9b1110a.yaml new file mode 100644 index 0000000000..179d5e3671 --- /dev/null +++ b/releasenotes/notes/endpoint_policy_driver_unused_methods_removed-e1348cbec9b1110a.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - The methods ``list_endpoints_for_policy()`` and + ``get_policy_for_endpoint()`` have been removed from the EndpointPolicy + driver interface.