diff options
author | Matthew Treinish <mtreinish@kortar.org> | 2016-10-04 13:04:52 -0400 |
---|---|---|
committer | Matthew Treinish <mtreinish@kortar.org> | 2016-10-05 11:27:13 -0400 |
commit | 00c72b90f69769d84a3d2944d4f6fdab438ef753 (patch) | |
tree | 4f15b59735335799cb5dd04e8912b83bc20664c7 /tempest/test_discover | |
parent | 4db514cc0178662163e337bc0cddbdc7357c2220 (diff) | |
download | tempest-00c72b90f69769d84a3d2944d4f6fdab438ef753.tar.gz |
Only call register_service_clients if there are clients
Right now we unconditionally run register_service_clients() on each
plugin regardless of whether there are any clients or not. This can lead
to false tracebacks being logged if there is any error reported in the
call path, regardless of whether the plugin is at fault or not. To
avoid this potential confusion this commit changes the registry call to
only occur if there are any clients we actually want to register. If
there aren't any we just skip that plugin.
Change-Id: I526d4acd99bbcfbf27c4090391f341bc61fdb194
Diffstat (limited to 'tempest/test_discover')
-rw-r--r-- | tempest/test_discover/plugins.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tempest/test_discover/plugins.py b/tempest/test_discover/plugins.py index eb5012690..f8d5d9de2 100644 --- a/tempest/test_discover/plugins.py +++ b/tempest/test_discover/plugins.py @@ -157,8 +157,10 @@ class TempestTestPluginManager(object): registry = clients.ClientsRegistry() for plug in self.ext_plugins: try: - registry.register_service_client( - plug.name, plug.obj.get_service_clients()) + service_clients = plug.obj.get_service_clients() + if service_clients: + registry.register_service_client( + plug.name, service_clients) except Exception: LOG.exception('Plugin %s raised an exception trying to run ' 'get_service_clients' % plug.name) |