From 3b6d599c9bc2317889607b815ce8e9a94b951922 Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Sun, 9 Apr 2017 18:57:16 +0200 Subject: [PATCH] Deprecate client_parameters from ServiceClients client_parameters was been designed as a way to pass parameters for service clients to the ServiceClients class. After the initial implementation, the client registry was added, which allows for automatic registration of all clients and their parameters. If configuration is available, parameters will be pushed into the registry automatically. When the registry part was implemented, the client_parameters logic has been broken. Parameters are loaded and prepared correctly, but ultimately they are not used for registration, they are basically ignored. So this commit simply deprecates client_parameters, so that once it's not used in tempest/clients.py anymore and the deprecation periodic is over it can be removed. closes-bug: #1680915 Change-Id: Ib37bde098d15ce440297728f0d0e1087b8693b6c --- ...te_client_parameters-cb8d069e62957f7e.yaml | 6 +++++ tempest/lib/services/clients.py | 24 +++++++++++-------- 2 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 releasenotes/notes/dreprecate_client_parameters-cb8d069e62957f7e.yaml diff --git a/releasenotes/notes/dreprecate_client_parameters-cb8d069e62957f7e.yaml b/releasenotes/notes/dreprecate_client_parameters-cb8d069e62957f7e.yaml new file mode 100644 index 0000000000..4081f6a4fb --- /dev/null +++ b/releasenotes/notes/dreprecate_client_parameters-cb8d069e62957f7e.yaml @@ -0,0 +1,6 @@ +--- +deprecations: + - | + Deprecate the client_parameters argument in + `tempest.lib.services.clients.ServiceClients`. The parameter is actually + not honoured already - see https://bugs.launchpad.net/tempest/+bug/1680915 diff --git a/tempest/lib/services/clients.py b/tempest/lib/services/clients.py index eefac6652d..0a06c04f0e 100644 --- a/tempest/lib/services/clients.py +++ b/tempest/lib/services/clients.py @@ -17,7 +17,9 @@ import copy import importlib import inspect +import warnings +from debtcollector import removals from oslo_log import log as logging from tempest.lib import auth @@ -29,7 +31,7 @@ from tempest.lib.services import image from tempest.lib.services import network from tempest.lib.services import volume - +warnings.simplefilter("once") LOG = logging.getLogger(__name__) @@ -257,6 +259,7 @@ class ServiceClients(object): # initialises this class using values from tempest CONF object. The wrapper # class should only be used by tests hosted in Tempest. + @removals.removed_kwarg('client_parameters') def __init__(self, credentials, identity_uri, region=None, scope='project', disable_ssl_certificate_validation=True, ca_certs=None, trace_requests='', client_parameters=None): @@ -272,7 +275,12 @@ class ServiceClients(object): Parameters dscv, ca_certs and trace_requests all apply to the auth provider as well as any service clients provided by this manager. - Any other client parameter must be set via client_parameters. + Any other client parameter should be set via ClientsRegistry. + + Client parameter used to be set via client_parameters, but this is + deprecated, and it is actually already not honoured + anymore: https://launchpad.net/bugs/1680915. + The list of available parameters is defined in the service clients interfaces. For reference, most clients will accept 'region', 'service', 'endpoint_type', 'build_timeout' and 'build_interval', which @@ -287,6 +295,10 @@ class ServiceClients(object): - Volume client for 'volume' accepts 'default_volume_size' - Servers client from 'compute' accepts 'enable_instance_password' + If Tempest configuration is used, parameters will be loaded in the + Registry automatically for all service client (Tempest stable ones + and plugins). + Examples: >>> identity_params = config.service_client_config('identity') @@ -311,14 +323,6 @@ class ServiceClients(object): for the version. Values are dictionaries of parameters that are going to be passed to all clients in the service client module. - Examples: - - >>> params_service_x = {'param_name': 'param_value'} - >>> client_parameters = { 'service_x': params_service_x } - - >>> params_service_y = config.service_client_config('service_y') - >>> client_parameters['service_y'] = params_service_y - """ self._registered_services = set([]) self.credentials = credentials