Merge "Fix invalid values when setting config options' default value"
diff --git a/releasenotes/notes/dreprecate_client_parameters-cb8d069e62957f7e.yaml b/releasenotes/notes/dreprecate_client_parameters-cb8d069e62957f7e.yaml
new file mode 100644
index 0000000..4081f6a
--- /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 eefac66..0a06c04 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 network
from tempest.lib.services import volume
-
+warnings.simplefilter("once")
LOG = logging.getLogger(__name__)
@@ -257,6 +259,7 @@
# 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 @@
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 @@
- 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 @@
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
diff --git a/tempest/test.py b/tempest/test.py
index 52994ac..70421fd 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -642,12 +642,24 @@
return fixed_network.get_tenant_network(
cred_provider, networks_client, CONF.compute.fixed_network_name)
- def assertEmpty(self, list, msg=None):
- if msg is None:
- msg = "list is not empty: %s" % list
- self.assertEqual(0, len(list), msg)
+ def assertEmpty(self, items, msg=None):
+ """Asserts whether a sequence or collection is empty
- def assertNotEmpty(self, list, msg=None):
+ :param items: sequence or collection to be tested
+ :param msg: message to be passed to the AssertionError
+ :raises AssertionError: when items is not empty
+ """
if msg is None:
- msg = "list is empty."
- self.assertGreater(len(list), 0, msg)
+ msg = "sequence or collection is not empty: %s" % items
+ self.assertEqual(0, len(items), msg)
+
+ def assertNotEmpty(self, items, msg=None):
+ """Asserts whether a sequence or collection is not empty
+
+ :param items: sequence or collection to be tested
+ :param msg: message to be passed to the AssertionError
+ :raises AssertionError: when items is empty
+ """
+ if msg is None:
+ msg = "sequence or collection is empty."
+ self.assertGreater(len(items), 0, msg)