Remove base_extensions_client for the reability
The service clients for the volume service are different from
the other services and it is a little difficult to read and
debug because that consists of multiple layers for v1 and v2.
That could be useful for the code optimization, but actually
the merit seems small and unreadable.
This patch removes these layers from the volume clients.
Partially implements blueprint consistent-service-method-names
Change-Id: Ib9a89d94da30592ee22a1d60bf419c4d988471c3
diff --git a/tempest/services/volume/base/base_extensions_client.py b/tempest/services/volume/base/base_extensions_client.py
deleted file mode 100644
index b90fe94..0000000
--- a/tempest/services/volume/base/base_extensions_client.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest.lib.common import rest_client
-
-
-class BaseExtensionsClient(rest_client.RestClient):
-
- def list_extensions(self):
- url = 'extensions'
- resp, body = self.get(url)
- body = json.loads(body)
- self.expected_success(200, resp.status)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest/services/volume/v1/json/extensions_client.py b/tempest/services/volume/v1/json/extensions_client.py
index f99d0f5..7b849a8 100644
--- a/tempest/services/volume/v1/json/extensions_client.py
+++ b/tempest/services/volume/v1/json/extensions_client.py
@@ -13,8 +13,17 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest.services.volume.base import base_extensions_client
+from oslo_serialization import jsonutils as json
+
+from tempest.lib.common import rest_client
-class ExtensionsClient(base_extensions_client.BaseExtensionsClient):
+class ExtensionsClient(rest_client.RestClient):
"""Volume V1 extensions client."""
+
+ def list_extensions(self):
+ url = 'extensions'
+ resp, body = self.get(url)
+ body = json.loads(body)
+ self.expected_success(200, resp.status)
+ return rest_client.ResponseBody(resp, body)
diff --git a/tempest/services/volume/v2/json/extensions_client.py b/tempest/services/volume/v2/json/extensions_client.py
index 245906f..09279d5 100644
--- a/tempest/services/volume/v2/json/extensions_client.py
+++ b/tempest/services/volume/v2/json/extensions_client.py
@@ -13,8 +13,18 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest.services.volume.base import base_extensions_client
+from oslo_serialization import jsonutils as json
+
+from tempest.lib.common import rest_client
-class ExtensionsClient(base_extensions_client.BaseExtensionsClient):
+class ExtensionsClient(rest_client.RestClient):
+ """Volume V2 extensions client."""
api_version = "v2"
+
+ def list_extensions(self):
+ url = 'extensions'
+ resp, body = self.get(url)
+ body = json.loads(body)
+ self.expected_success(200, resp.status)
+ return rest_client.ResponseBody(resp, body)