From c33486f1ea3306ecb8f4ae6b944a332ba94dd3f1 Mon Sep 17 00:00:00 2001 From: "Andrea Frittoli (andreaf)" Date: Fri, 17 Jun 2016 12:22:08 +0100 Subject: [PATCH] Service client modules in various services __init__ Import the remaning service client classes in the __init__ of the corresponding services module, and define __all__, so that service client classes may be accessed by importing the service module only. Change-Id: Id7428ac7bc9aeffed21a5e99c3f520f1568f2018 Partially-implements: bp client-manager-refactor --- tempest/clients.py | 28 +++++++------------- tempest/services/baremetal/__init__.py | 18 +++++++++++++ tempest/services/data_processing/__init__.py | 18 +++++++++++++ tempest/services/database/__init__.py | 23 ++++++++++++++++ tempest/services/orchestration/__init__.py | 18 +++++++++++++ 5 files changed, 87 insertions(+), 18 deletions(-) diff --git a/tempest/clients.py b/tempest/clients.py index 2398d3eece..b7bc4fab94 100644 --- a/tempest/clients.py +++ b/tempest/clients.py @@ -23,21 +23,13 @@ from tempest import exceptions from tempest.lib.services import compute from tempest.lib.services import network from tempest import manager -from tempest.services.baremetal.v1.json.baremetal_client import \ - BaremetalClient -from tempest.services.data_processing.v1_1.data_processing_client import \ - DataProcessingClient -from tempest.services.database.json.flavors_client import \ - DatabaseFlavorsClient -from tempest.services.database.json.limits_client import \ - DatabaseLimitsClient -from tempest.services.database.json.versions_client import \ - DatabaseVersionsClient +from tempest.services import baremetal +from tempest.services import data_processing +from tempest.services import database from tempest.services import identity from tempest.services import image from tempest.services import object_storage -from tempest.services.orchestration.json.orchestration_client import \ - OrchestrationClient +from tempest.services import orchestration from tempest.services import volume CONF = config.CONF @@ -79,13 +71,13 @@ class Manager(manager.Manager): self._set_image_clients() self._set_network_clients() - self.baremetal_client = BaremetalClient( + self.baremetal_client = baremetal.BaremetalClient( self.auth_provider, CONF.baremetal.catalog_type, CONF.identity.region, endpoint_type=CONF.baremetal.endpoint_type, **self.default_params_with_timeout_values) - self.orchestration_client = OrchestrationClient( + self.orchestration_client = orchestration.OrchestrationClient( self.auth_provider, CONF.orchestration.catalog_type, CONF.orchestration.region or CONF.identity.region, @@ -93,7 +85,7 @@ class Manager(manager.Manager): build_interval=CONF.orchestration.build_interval, build_timeout=CONF.orchestration.build_timeout, **self.default_params) - self.data_processing_client = DataProcessingClient( + self.data_processing_client = data_processing.DataProcessingClient( self.auth_provider, CONF.data_processing.catalog_type, CONF.identity.region, @@ -252,17 +244,17 @@ class Manager(manager.Manager): self.auth_provider, **params_volume) def _set_database_clients(self): - self.database_flavors_client = DatabaseFlavorsClient( + self.database_flavors_client = database.DatabaseFlavorsClient( self.auth_provider, CONF.database.catalog_type, CONF.identity.region, **self.default_params_with_timeout_values) - self.database_limits_client = DatabaseLimitsClient( + self.database_limits_client = database.DatabaseLimitsClient( self.auth_provider, CONF.database.catalog_type, CONF.identity.region, **self.default_params_with_timeout_values) - self.database_versions_client = DatabaseVersionsClient( + self.database_versions_client = database.DatabaseVersionsClient( self.auth_provider, CONF.database.catalog_type, CONF.identity.region, diff --git a/tempest/services/baremetal/__init__.py b/tempest/services/baremetal/__init__.py index e69de29bb2..390f40a7d2 100644 --- a/tempest/services/baremetal/__init__.py +++ b/tempest/services/baremetal/__init__.py @@ -0,0 +1,18 @@ +# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P. +# +# 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 tempest.services.baremetal.v1.json.baremetal_client import \ + BaremetalClient + +__all__ = ['BaremetalClient'] diff --git a/tempest/services/data_processing/__init__.py b/tempest/services/data_processing/__init__.py index e69de29bb2..c49bc5c3d3 100644 --- a/tempest/services/data_processing/__init__.py +++ b/tempest/services/data_processing/__init__.py @@ -0,0 +1,18 @@ +# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P. +# +# 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 tempest.services.data_processing.v1_1.data_processing_client import \ + DataProcessingClient + +__all__ = ['DataProcessingClient'] diff --git a/tempest/services/database/__init__.py b/tempest/services/database/__init__.py index e69de29bb2..9a742d85b4 100644 --- a/tempest/services/database/__init__.py +++ b/tempest/services/database/__init__.py @@ -0,0 +1,23 @@ +# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P. +# +# 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 tempest.services.database.json.flavors_client import \ + DatabaseFlavorsClient +from tempest.services.database.json.limits_client import \ + DatabaseLimitsClient +from tempest.services.database.json.versions_client import \ + DatabaseVersionsClient + +__all__ = ['DatabaseFlavorsClient', 'DatabaseLimitsClient', + 'DatabaseVersionsClient'] diff --git a/tempest/services/orchestration/__init__.py b/tempest/services/orchestration/__init__.py index e69de29bb2..5a1ffcc30c 100644 --- a/tempest/services/orchestration/__init__.py +++ b/tempest/services/orchestration/__init__.py @@ -0,0 +1,18 @@ +# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P. +# +# 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 tempest.services.orchestration.json.orchestration_client import \ + OrchestrationClient + +__all__ = ['OrchestrationClient']