aboutsummaryrefslogtreecommitdiffstats
path: root/keystone-moon/keystone/endpoint_policy/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'keystone-moon/keystone/endpoint_policy/core.py')
-rw-r--r--keystone-moon/keystone/endpoint_policy/core.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/keystone-moon/keystone/endpoint_policy/core.py b/keystone-moon/keystone/endpoint_policy/core.py
index e176ac1c..6243f26b 100644
--- a/keystone-moon/keystone/endpoint_policy/core.py
+++ b/keystone-moon/keystone/endpoint_policy/core.py
@@ -127,7 +127,6 @@ class Manager(manager.Manager):
:returns: list of endpoints that match
"""
-
if region_id in regions_examined:
msg = _LE('Circular reference or a repeated entry found '
'in region tree - %(region_id)s.')
@@ -159,7 +158,7 @@ class Manager(manager.Manager):
matching_endpoints = []
endpoints = self.catalog_api.list_endpoints()
regions = self.catalog_api.list_regions()
- for ref in self.driver.list_associations_for_policy(policy_id):
+ for ref in self.list_associations_for_policy(policy_id):
if ref.get('endpoint_id') is not None:
matching_endpoints.append(
_get_endpoint(ref['endpoint_id'], policy_id))
@@ -213,11 +212,12 @@ class Manager(manager.Manager):
regions_examined = []
while region_id is not None:
try:
- ref = self.driver.get_policy_association(
+ ref = self.get_policy_association(
service_id=endpoint['service_id'],
region_id=region_id)
return ref['policy_id']
- except exception.PolicyAssociationNotFound:
+ except exception.PolicyAssociationNotFound: # nosec
+ # There wasn't one for that region & service, handle below.
pass
# There wasn't one for that region & service, let's
@@ -237,9 +237,11 @@ class Manager(manager.Manager):
# this endpoint.
try:
- ref = self.driver.get_policy_association(endpoint_id=endpoint_id)
+ ref = self.get_policy_association(endpoint_id=endpoint_id)
return _get_policy(ref['policy_id'], endpoint_id)
- except exception.PolicyAssociationNotFound:
+ except exception.PolicyAssociationNotFound: # nosec
+ # There wasn't a policy explicitly defined for this endpoint,
+ # handled below.
pass
# There wasn't a policy explicitly defined for this endpoint, so
@@ -252,10 +254,11 @@ class Manager(manager.Manager):
# Finally, just check if there is one for the service.
try:
- ref = self.driver.get_policy_association(
+ ref = self.get_policy_association(
service_id=endpoint['service_id'])
return _get_policy(ref['policy_id'], endpoint_id)
- except exception.PolicyAssociationNotFound:
+ except exception.PolicyAssociationNotFound: # nosec
+ # No policy is associated with endpoint, handled below.
pass
msg = _('No policy is associated with endpoint '
@@ -304,8 +307,8 @@ class EndpointPolicyDriverV8(object):
:type service_id: string
:param region_id: identity of the region to associate
:type region_id: string
- :raises: keystone.exception.PolicyAssociationNotFound if there is no
- match for the specified association
+ :raises keystone.exception.PolicyAssociationNotFound: If there is no
+ match for the specified association.
:returns: None
"""
@@ -343,8 +346,8 @@ class EndpointPolicyDriverV8(object):
:type service_id: string
:param region_id: identity of the region
:type region_id: string
- :raises: keystone.exception.PolicyAssociationNotFound if there is no
- match for the specified association
+ :raises keystone.exception.PolicyAssociationNotFound: If there is no
+ match for the specified association.
:returns: dict containing policy_id
"""