Make identity clients use rest_client
Now service_client is unnecessary because that is the same as
rest_client. This patch makes identity clients use the rest_client,
and we will remove service_client for the cleanup in the future.
This patch removes these clients from a certain test because this
test is just for service_client, not rest_client as the test name.
We have added this test for verifying all arguments are passed into
rest_client via service_client. However, this patch some clients use
rest_client directly, so this test becomes meaningless for these
clients. That is a reason why the migrated clients(into tempest.lib
before) are not contained in this test.
Partially implements blueprint consistent-service-method-names
Change-Id: I5de906bcc0e32063ff17ee75f8dcf91b99165d03
diff --git a/tempest/services/identity/v3/json/regions_client.py b/tempest/services/identity/v3/json/regions_client.py
index bc4b7a1..90dd9d7 100644
--- a/tempest/services/identity/v3/json/regions_client.py
+++ b/tempest/services/identity/v3/json/regions_client.py
@@ -20,10 +20,10 @@
from oslo_serialization import jsonutils as json
from six.moves.urllib import parse as urllib
-from tempest.common import service_client
+from tempest.lib.common import rest_client
-class RegionsClient(service_client.ServiceClient):
+class RegionsClient(rest_client.RestClient):
api_version = "v3"
def create_region(self, region_id=None, **kwargs):
@@ -45,7 +45,7 @@
resp, body = method(url, req_body)
self.expected_success(201, resp.status)
body = json.loads(body)
- return service_client.ResponseBody(resp, body)
+ return rest_client.ResponseBody(resp, body)
def update_region(self, region_id, **kwargs):
"""Updates a region.
@@ -57,7 +57,7 @@
resp, body = self.patch('regions/%s' % region_id, post_body)
self.expected_success(200, resp.status)
body = json.loads(body)
- return service_client.ResponseBody(resp, body)
+ return rest_client.ResponseBody(resp, body)
def show_region(self, region_id):
"""Get region."""
@@ -65,7 +65,7 @@
resp, body = self.get(url)
self.expected_success(200, resp.status)
body = json.loads(body)
- return service_client.ResponseBody(resp, body)
+ return rest_client.ResponseBody(resp, body)
def list_regions(self, params=None):
"""List regions."""
@@ -75,10 +75,10 @@
resp, body = self.get(url)
self.expected_success(200, resp.status)
body = json.loads(body)
- return service_client.ResponseBody(resp, body)
+ return rest_client.ResponseBody(resp, body)
def delete_region(self, region_id):
"""Delete region."""
resp, body = self.delete('regions/%s' % region_id)
self.expected_success(204, resp.status)
- return service_client.ResponseBody(resp, body)
+ return rest_client.ResponseBody(resp, body)