| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 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 |