Debian Codegraph @

keystoneclient/v3/contrib/federation/base.py

raw symbols SCIP
1 # Licensed under the Apache License, Version 2.0 (the "License"); you may
2 # not use this file except in compliance with the License. You may obtain
3 # a copy of the License at
4 #
5 # http://www.apache.org/licenses/LICENSE-2.0
6 #
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 # License for the specific language governing permissions and limitations
11 # under the License.
12
13 import abc
14
15 from keystoneauth1 import exceptions
16 from keystoneauth1 import plugin
17
18 from keystoneclient import base
19
20
21 class EntityManager(base.Manager, metaclass=abc.ABCMeta):
22 """Manager class for listing federated accessible objects."""
23
24 resource_class = None
25
26 @property
27 @abc.abstractmethod
28 def object_type(self):
29 raise exceptions.MethodNotImplemented
30
31 def list(self):
32 url = '/auth/%s' % self.object_type
33 try:
34 tenant_list = self._list(url, self.object_type)
35 except exceptions.CatalogException:
36 endpoint_filter = {'interface': plugin.AUTH_INTERFACE}
37 tenant_list = self._list(url, self.object_type,
38 endpoint_filter=endpoint_filter)
39 return tenant_list