summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-11-29 20:40:07 +0000
committerGerrit Code Review <review@openstack.org>2018-11-29 20:40:07 +0000
commit7c438da88c5789bb38f9a0f59f03d47b4a3134e4 (patch)
treeb780ee9678decef7ee4943c70f04356f41237b44
parent05d035588bf2d365e050cdfc37db41c18aa7fafa (diff)
parente7621bddc16de6371a05567a8ab23e7ccd67fba7 (diff)
downloadpython-keystoneclient-7c438da88c5789bb38f9a0f59f03d47b4a3134e4.tar.gz
Merge "Add return-request-id-to-caller function(v3/contrib)"
-rw-r--r--keystoneclient/tests/unit/v3/test_federation.py242
-rw-r--r--keystoneclient/tests/unit/v3/test_oauth1.py48
-rw-r--r--keystoneclient/tests/unit/v3/test_projects.py14
-rw-r--r--keystoneclient/tests/unit/v3/test_simple_cert.py33
-rw-r--r--keystoneclient/tests/unit/v3/utils.py18
-rw-r--r--keystoneclient/v3/contrib/endpoint_policy.py25
-rw-r--r--keystoneclient/v3/contrib/oauth1/access_tokens.py3
-rw-r--r--keystoneclient/v3/contrib/oauth1/request_tokens.py3
-rw-r--r--keystoneclient/v3/contrib/simple_cert.py7
9 files changed, 364 insertions, 29 deletions
diff --git a/keystoneclient/tests/unit/v3/test_federation.py b/keystoneclient/tests/unit/v3/test_federation.py
index a760ed7..096c1f5 100644
--- a/keystoneclient/tests/unit/v3/test_federation.py
+++ b/keystoneclient/tests/unit/v3/test_federation.py
@@ -11,6 +11,7 @@
# under the License.
import copy
+import fixtures
import uuid
from keystoneauth1 import exceptions
@@ -582,3 +583,244 @@ class ServiceProviderTests(utils.ClientTestCase, utils.CrudTests):
req_ref[attr],
'Expected different %s' % attr)
self.assertEntityRequestBodyIs(req_ref)
+
+
+class IdentityProviderRequestIdTests(utils.TestRequestId):
+
+ def setUp(self):
+ super(IdentityProviderRequestIdTests, self).setUp()
+ self.mgr = identity_providers.IdentityProviderManager(self.client)
+
+ def _mock_request_method(self, method=None, body=None):
+ return self.useFixture(fixtures.MockPatchObject(
+ self.client, method, autospec=True,
+ return_value=(self.resp, body))
+ ).mock
+
+ def test_get_identity_provider(self):
+ body = {"identity_provider": {"name": "admin"}}
+ get_mock = self._mock_request_method(method='get', body=body)
+
+ response = self.mgr.get("admin")
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with(
+ 'OS-FEDERATION/identity_providers/admin')
+
+ def test_list_identity_provider(self):
+ body = {"identity_providers": [{"name": "admin"}]}
+ get_mock = self._mock_request_method(method='get', body=body)
+
+ response = self.mgr.list()
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with('OS-FEDERATION/identity_providers?')
+
+ def test_create_identity_provider(self):
+ body = {"identity_provider": {"name": "admin"}}
+ self._mock_request_method(method='post', body=body)
+ put_mock = self._mock_request_method(method='put', body=body)
+
+ response = self.mgr.create(id="admin", description='fake')
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ put_mock.assert_called_once_with(
+ 'OS-FEDERATION/identity_providers/admin',
+ body={'identity_provider': {'description': 'fake'}})
+
+ def test_update_identity_provider(self):
+ body = {"identity_provider": {"name": "admin"}}
+ patch_mock = self._mock_request_method(method='patch', body=body)
+ self._mock_request_method(method='post', body=body)
+
+ response = self.mgr.update("admin")
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ patch_mock.assert_called_once_with(
+ 'OS-FEDERATION/identity_providers/admin', body={
+ 'identity_provider': {}})
+
+ def test_delete_identity_provider(self):
+ get_mock = self._mock_request_method(method='delete')
+
+ _, resp = self.mgr.delete("admin")
+ self.assertEqual(resp.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with(
+ 'OS-FEDERATION/identity_providers/admin')
+
+
+class MappingRequestIdTests(utils.TestRequestId):
+
+ def setUp(self):
+ super(MappingRequestIdTests, self).setUp()
+ self.mgr = mappings.MappingManager(self.client)
+
+ def _mock_request_method(self, method=None, body=None):
+ return self.useFixture(fixtures.MockPatchObject(
+ self.client, method, autospec=True,
+ return_value=(self.resp, body))
+ ).mock
+
+ def test_get_mapping(self):
+ body = {"mapping": {"name": "admin"}}
+ get_mock = self._mock_request_method(method='get', body=body)
+
+ response = self.mgr.get("admin")
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with('OS-FEDERATION/mappings/admin')
+
+ def test_list_mapping(self):
+ body = {"mappings": [{"name": "admin"}]}
+ get_mock = self._mock_request_method(method='get', body=body)
+
+ response = self.mgr.list()
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with('OS-FEDERATION/mappings?')
+
+ def test_create_mapping(self):
+ body = {"mapping": {"name": "admin"}}
+ self._mock_request_method(method='post', body=body)
+ put_mock = self._mock_request_method(method='put', body=body)
+
+ response = self.mgr.create(mapping_id="admin", description='fake')
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ put_mock.assert_called_once_with(
+ 'OS-FEDERATION/mappings/admin', body={
+ 'mapping': {'description': 'fake'}})
+
+ def test_update_mapping(self):
+ body = {"mapping": {"name": "admin"}}
+ patch_mock = self._mock_request_method(method='patch', body=body)
+ self._mock_request_method(method='post', body=body)
+
+ response = self.mgr.update("admin")
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ patch_mock.assert_called_once_with(
+ 'OS-FEDERATION/mappings/admin', body={'mapping': {}})
+
+ def test_delete_mapping(self):
+ get_mock = self._mock_request_method(method='delete')
+
+ _, resp = self.mgr.delete("admin")
+ self.assertEqual(resp.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with('OS-FEDERATION/mappings/admin')
+
+
+class ProtocolRequestIdTests(utils.TestRequestId):
+
+ def setUp(self):
+ super(ProtocolRequestIdTests, self).setUp()
+ self.mgr = protocols.ProtocolManager(self.client)
+
+ def _mock_request_method(self, method=None, body=None):
+ return self.useFixture(fixtures.MockPatchObject(
+ self.client, method, autospec=True,
+ return_value=(self.resp, body))
+ ).mock
+
+ def test_get_protocol(self):
+ body = {"protocol": {"name": "admin"}}
+ get_mock = self._mock_request_method(method='get', body=body)
+
+ response = self.mgr.get("admin", "protocol")
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with(
+ 'OS-FEDERATION/identity_providers/admin/protocols/protocol')
+
+ def test_list_protocol(self):
+ body = {"protocols": [{"name": "admin"}]}
+ get_mock = self._mock_request_method(method='get', body=body)
+
+ response = self.mgr.list("identity_provider")
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with(
+ 'OS-FEDERATION/identity_providers/identity_provider/protocols?')
+
+ def test_create_protocol(self):
+ body = {"protocol": {"name": "admin"}}
+ self._mock_request_method(method='post', body=body)
+ put_mock = self._mock_request_method(method='put', body=body)
+
+ response = self.mgr.create(
+ protocol_id="admin", identity_provider='fake', mapping='fake')
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ put_mock.assert_called_once_with(
+ 'OS-FEDERATION/identity_providers/fake/protocols/admin', body={
+ 'protocol': {'mapping_id': 'fake'}})
+
+ def test_update_protocol(self):
+ body = {"protocol": {"name": "admin"}}
+ patch_mock = self._mock_request_method(method='patch', body=body)
+ self._mock_request_method(method='post', body=body)
+
+ response = self.mgr.update(protocol="admin", identity_provider='fake',
+ mapping='fake')
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ patch_mock.assert_called_once_with(
+ 'OS-FEDERATION/identity_providers/fake/protocols/admin', body={
+ 'protocol': {'mapping_id': 'fake'}})
+
+ def test_delete_protocol(self):
+ get_mock = self._mock_request_method(method='delete')
+
+ _, resp = self.mgr.delete("identity_provider", "protocol")
+ self.assertEqual(resp.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with(
+ 'OS-FEDERATION/identity_providers/'
+ 'identity_provider/protocols/protocol')
+
+
+class ServiceProviderRequestIdTests(utils.TestRequestId):
+
+ def setUp(self):
+ super(ServiceProviderRequestIdTests, self).setUp()
+ self.mgr = service_providers.ServiceProviderManager(self.client)
+
+ def _mock_request_method(self, method=None, body=None):
+ return self.useFixture(fixtures.MockPatchObject(
+ self.client, method, autospec=True,
+ return_value=(self.resp, body))
+ ).mock
+
+ def test_get_service_provider(self):
+ body = {"service_provider": {"name": "admin"}}
+ get_mock = self._mock_request_method(method='get', body=body)
+
+ response = self.mgr.get("provider")
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with(
+ 'OS-FEDERATION/service_providers/provider')
+
+ def test_list_service_provider(self):
+ body = {"service_providers": [{"name": "admin"}]}
+ get_mock = self._mock_request_method(method='get', body=body)
+
+ response = self.mgr.list()
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with('OS-FEDERATION/service_providers?')
+
+ def test_create_service_provider(self):
+ body = {"service_provider": {"name": "admin"}}
+ self._mock_request_method(method='post', body=body)
+ put_mock = self._mock_request_method(method='put', body=body)
+
+ response = self.mgr.create(id='provider')
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ put_mock.assert_called_once_with(
+ 'OS-FEDERATION/service_providers/provider', body={
+ 'service_provider': {}})
+
+ def test_update_service_provider(self):
+ body = {"service_provider": {"name": "admin"}}
+ patch_mock = self._mock_request_method(method='patch', body=body)
+ self._mock_request_method(method='post', body=body)
+
+ response = self.mgr.update("provider")
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ patch_mock.assert_called_once_with(
+ 'OS-FEDERATION/service_providers/provider', body={
+ 'service_provider': {}})
+
+ def test_delete_service_provider(self):
+ get_mock = self._mock_request_method(method='delete')
+
+ _, resp = self.mgr.delete("provider")
+ self.assertEqual(resp.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with(
+ 'OS-FEDERATION/service_providers/provider')
diff --git a/keystoneclient/tests/unit/v3/test_oauth1.py b/keystoneclient/tests/unit/v3/test_oauth1.py
index f939244..644e8a8 100644
--- a/keystoneclient/tests/unit/v3/test_oauth1.py
+++ b/keystoneclient/tests/unit/v3/test_oauth1.py
@@ -11,6 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import fixtures
import uuid
import mock
@@ -277,6 +278,53 @@ class AuthenticateWithOAuthTests(utils.TestCase, TokenTests):
oauth_client)
+class OauthRequestIdTests(utils.TestRequestId, TokenTests):
+
+ def setUp(self):
+ super(OauthRequestIdTests, self).setUp()
+ self.mgr = consumers.ConsumerManager(self.client)
+
+ def _mock_request_method(self, method=None, body=None):
+ return self.useFixture(fixtures.MockPatchObject(
+ self.client, method, autospec=True,
+ return_value=(self.resp, body))
+ ).mock
+
+ def test_get_consumers(self):
+ body = {"consumer": {"name": "admin"}}
+ get_mock = self._mock_request_method(method='get', body=body)
+
+ response = self.mgr.get("admin")
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with('/OS-OAUTH1/consumers/admin')
+
+ def test_create_consumers(self):
+ body = {"consumer": {"name": "admin"}}
+ post_mock = self._mock_request_method(method='post', body=body)
+
+ response = self.mgr.create(name="admin", description="fake")
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ post_mock.assert_called_once_with('/OS-OAUTH1/consumers', body={
+ 'consumer': {'name': 'admin', 'description': 'fake'}})
+
+ def test_update_consumers(self):
+ body = {"consumer": {"name": "admin"}}
+ patch_mock = self._mock_request_method(method='patch', body=body)
+ self._mock_request_method(method='post', body=body)
+
+ response = self.mgr.update("admin", "demo")
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ patch_mock.assert_called_once_with('/OS-OAUTH1/consumers/admin', body={
+ 'consumer': {'description': 'demo'}})
+
+ def test_delete_consumers(self):
+ get_mock = self._mock_request_method(method='delete')
+
+ _, resp = self.mgr.delete("admin")
+ self.assertEqual(resp.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with('/OS-OAUTH1/consumers/admin')
+
+
class TestOAuthLibModule(utils.TestCase):
def test_no_oauthlib_installed(self):
diff --git a/keystoneclient/tests/unit/v3/test_projects.py b/keystoneclient/tests/unit/v3/test_projects.py
index fd91bac..2df8f05 100644
--- a/keystoneclient/tests/unit/v3/test_projects.py
+++ b/keystoneclient/tests/unit/v3/test_projects.py
@@ -11,16 +11,12 @@
# under the License.
import fixtures
-import requests
import uuid
from keystoneauth1 import exceptions as ksa_exceptions
-from keystoneauth1.identity import v3
-from keystoneauth1 import session
from keystoneclient import exceptions as ksc_exceptions
from keystoneclient.tests.unit.v3 import utils
-from keystoneclient.v3 import client
from keystoneclient.v3 import projects
@@ -402,20 +398,12 @@ class ProjectTests(utils.ClientTestCase, utils.CrudTests):
return ret
-class ProjectsRequestIdTests(utils.TestCase):
+class ProjectsRequestIdTests(utils.TestRequestId):
url = "/projects"
- resp = requests.Response()
- TEST_REQUEST_ID = uuid.uuid4().hex
- resp.headers['x-openstack-request-id'] = TEST_REQUEST_ID
def setUp(self):
super(ProjectsRequestIdTests, self).setUp()
- auth = v3.Token(auth_url='http://127.0.0.1:5000',
- token=self.TEST_TOKEN)
- session_ = session.Session(auth=auth)
- self.client = client.Client(session=session_,
- include_metadata='True')._adapter
self.mgr = projects.ProjectManager(self.client)
self.mgr.resource_class = projects.Project
diff --git a/keystoneclient/tests/unit/v3/test_simple_cert.py b/keystoneclient/tests/unit/v3/test_simple_cert.py
index 1c4a245..a059f08 100644
--- a/keystoneclient/tests/unit/v3/test_simple_cert.py
+++ b/keystoneclient/tests/unit/v3/test_simple_cert.py
@@ -11,10 +11,12 @@
# License for the specific language governing permissions and limitations
# under the License.
+import fixtures
import testresources
from keystoneclient.tests.unit import client_fixtures
from keystoneclient.tests.unit.v3 import utils
+from keystoneclient.v3.contrib import simple_cert
class SimpleCertTests(utils.ClientTestCase, testresources.ResourcedTestCase):
@@ -36,5 +38,36 @@ class SimpleCertTests(utils.ClientTestCase, testresources.ResourcedTestCase):
self.assertEqual(self.examples.SIGNING_CERT, res)
+class SimpleCertRequestIdTests(utils.TestRequestId):
+
+ def setUp(self):
+ super(SimpleCertRequestIdTests, self).setUp()
+ self.mgr = simple_cert.SimpleCertManager(self.client)
+
+ def _mock_request_method(self, method=None, body=None):
+ return self.useFixture(fixtures.MockPatchObject(
+ self.client, method, autospec=True,
+ return_value=(self.resp, body))
+ ).mock
+
+ def test_list_ca_certificates(self):
+ body = {"certificates": [{"name": "admin"}, {"name": "admin2"}]}
+ get_mock = self._mock_request_method(method='get', body=body)
+
+ response = self.mgr.get_ca_certificates()
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with(
+ '/OS-SIMPLE-CERT/ca', authenticated=False)
+
+ def test_list_certificates(self):
+ body = {"certificates": [{"name": "admin"}, {"name": "admin2"}]}
+ get_mock = self._mock_request_method(method='get', body=body)
+
+ response = self.mgr.get_certificates()
+ self.assertEqual(response.request_ids[0], self.TEST_REQUEST_ID)
+ get_mock.assert_called_once_with(
+ '/OS-SIMPLE-CERT/certificates', authenticated=False)
+
+
def load_tests(loader, tests, pattern):
return testresources.OptimisingTestSuite(tests)
diff --git a/keystoneclient/tests/unit/v3/utils.py b/keystoneclient/tests/unit/v3/utils.py
index 5781a92..22430fa 100644
--- a/keystoneclient/tests/unit/v3/utils.py
+++ b/keystoneclient/tests/unit/v3/utils.py
@@ -10,12 +10,16 @@
# License for the specific language governing permissions and limitations
# under the License.
+import requests
import uuid
from six.moves.urllib import parse as urlparse
+from keystoneauth1.identity import v3
+from keystoneauth1 import session
from keystoneclient.tests.unit import client_fixtures
from keystoneclient.tests.unit import utils
+from keystoneclient.v3 import client
def parameterize(ref):
@@ -375,3 +379,17 @@ class CrudTests(object):
self.stub_entity('DELETE', id=ref['id'], status_code=204)
self.manager.delete(ref['id'])
+
+
+class TestRequestId(TestCase):
+ resp = requests.Response()
+ TEST_REQUEST_ID = uuid.uuid4().hex
+ resp.headers['x-openstack-request-id'] = TEST_REQUEST_ID
+
+ def setUp(self):
+ super(TestRequestId, self).setUp()
+ auth = v3.Token(auth_url='http://127.0.0.1:5000',
+ token=self.TEST_TOKEN)
+ session_ = session.Session(auth=auth)
+ self.client = client.Client(session=session_,
+ include_metadata='True')._adapter
diff --git a/keystoneclient/v3/contrib/endpoint_policy.py b/keystoneclient/v3/contrib/endpoint_policy.py
index 24148c1..c65b1fb 100644
--- a/keystoneclient/v3/contrib/endpoint_policy.py
+++ b/keystoneclient/v3/contrib/endpoint_policy.py
@@ -39,17 +39,17 @@ class EndpointPolicyManager(base.Manager):
def create_policy_association_for_endpoint(self, policy, endpoint):
"""Create an association between a policy and an endpoint."""
- self._act_on_policy_association_for_endpoint(
+ return self._act_on_policy_association_for_endpoint(
policy, endpoint, self._put)
def check_policy_association_for_endpoint(self, policy, endpoint):
"""Check an association between a policy and an endpoint."""
- self._act_on_policy_association_for_endpoint(
+ return self._act_on_policy_association_for_endpoint(
policy, endpoint, self._head)
def delete_policy_association_for_endpoint(self, policy, endpoint):
"""Delete an association between a policy and an endpoint."""
- self._act_on_policy_association_for_endpoint(
+ return self._act_on_policy_association_for_endpoint(
policy, endpoint, self._delete)
def _act_on_policy_association_for_service(self, policy, service, action):
@@ -67,17 +67,17 @@ class EndpointPolicyManager(base.Manager):
def create_policy_association_for_service(self, policy, service):
"""Create an association between a policy and a service."""
- self._act_on_policy_association_for_service(
+ return self._act_on_policy_association_for_service(
policy, service, self._put)
def check_policy_association_for_service(self, policy, service):
"""Check an association between a policy and a service."""
- self._act_on_policy_association_for_service(
+ return self._act_on_policy_association_for_service(
policy, service, self._head)
def delete_policy_association_for_service(self, policy, service):
"""Delete an association between a policy and a service."""
- self._act_on_policy_association_for_service(
+ return self._act_on_policy_association_for_service(
policy, service, self._delete)
def _act_on_policy_association_for_region_and_service(
@@ -99,19 +99,19 @@ class EndpointPolicyManager(base.Manager):
def create_policy_association_for_region_and_service(
self, policy, region, service):
"""Create an association between a policy and a service in a region."""
- self._act_on_policy_association_for_region_and_service(
+ return self._act_on_policy_association_for_region_and_service(
policy, region, service, self._put)
def check_policy_association_for_region_and_service(
self, policy, region, service):
"""Check an association between a policy and a service in a region."""
- self._act_on_policy_association_for_region_and_service(
+ return self._act_on_policy_association_for_region_and_service(
policy, region, service, self._head)
def delete_policy_association_for_region_and_service(
self, policy, region, service):
"""Delete an association between a policy and a service in a region."""
- self._act_on_policy_association_for_region_and_service(
+ return self._act_on_policy_association_for_region_and_service(
policy, region, service, self._delete)
def get_policy_for_endpoint(self, endpoint):
@@ -130,9 +130,10 @@ class EndpointPolicyManager(base.Manager):
'endpoint_id': endpoint_id,
'ext_name': self.OS_EP_POLICY_EXT}
- _resp, body = self.client.get(url)
- return policies.Policy(
- self, body[policies.PolicyManager.key], loaded=True)
+ resp, body = self.client.get(url)
+ return self._prepare_return_value(
+ resp, policies.Policy(self, body[policies.PolicyManager.key],
+ loaded=True))
def list_endpoints_for_policy(self, policy):
"""List endpoints with the effective association to a policy.
diff --git a/keystoneclient/v3/contrib/oauth1/access_tokens.py b/keystoneclient/v3/contrib/oauth1/access_tokens.py
index 37f1941..b32eaf3 100644
--- a/keystoneclient/v3/contrib/oauth1/access_tokens.py
+++ b/keystoneclient/v3/contrib/oauth1/access_tokens.py
@@ -48,4 +48,5 @@ class AccessTokenManager(base.CrudManager):
http_method='POST')
resp, body = self.client.post(endpoint, headers=headers)
token = utils.get_oauth_token_from_body(resp.content)
- return self.resource_class(self, token)
+ return self._prepare_return_value(resp,
+ self.resource_class(self, token))
diff --git a/keystoneclient/v3/contrib/oauth1/request_tokens.py b/keystoneclient/v3/contrib/oauth1/request_tokens.py
index 59f06bc..0efe2de 100644
--- a/keystoneclient/v3/contrib/oauth1/request_tokens.py
+++ b/keystoneclient/v3/contrib/oauth1/request_tokens.py
@@ -70,4 +70,5 @@ class RequestTokenManager(base.CrudManager):
headers=headers)
resp, body = self.client.post(endpoint, headers=headers)
token = utils.get_oauth_token_from_body(resp.content)
- return self.resource_class(self, token)
+ return self._prepare_return_value(resp,
+ self.resource_class(self, token))
diff --git a/keystoneclient/v3/contrib/simple_cert.py b/keystoneclient/v3/contrib/simple_cert.py
index 8168e67..6b58b27 100644
--- a/keystoneclient/v3/contrib/simple_cert.py
+++ b/keystoneclient/v3/contrib/simple_cert.py
@@ -11,12 +11,15 @@
# License for the specific language governing permissions and limitations
# under the License.
+from keystoneclient import base
+
class SimpleCertManager(object):
"""Manager for the OS-SIMPLE-CERT extension."""
def __init__(self, client):
self._client = client
+ self.mgr = base.Manager(self._client)
def get_ca_certificates(self):
"""Get CA certificates.
@@ -27,7 +30,7 @@ class SimpleCertManager(object):
"""
resp, body = self._client.get('/OS-SIMPLE-CERT/ca',
authenticated=False)
- return resp.text
+ return self.mgr._prepare_return_value(resp, resp.text)
def get_certificates(self):
"""Get signing certificates.
@@ -38,4 +41,4 @@ class SimpleCertManager(object):
"""
resp, body = self._client.get('/OS-SIMPLE-CERT/certificates',
authenticated=False)
- return resp.text
+ return self.mgr._prepare_return_value(resp, resp.text)