Merge "Only call register_service_clients if there are clients"
This commit is contained in:
commit
c466a14448
@ -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)
|
||||
|
@ -75,7 +75,5 @@ class TestPluginDiscovery(base.TestCase):
|
||||
fake_obj = fake_plugin.FakeStevedoreObjNoServiceClients()
|
||||
manager.ext_plugins = [fake_obj]
|
||||
manager._register_service_clients()
|
||||
expected_result = []
|
||||
registered_clients = registry.get_service_clients()
|
||||
self.assertIn(fake_obj.name, registered_clients)
|
||||
self.assertEqual(expected_result, registered_clients[fake_obj.name])
|
||||
self.assertNotIn(fake_obj.name, registered_clients)
|
||||
|
Loading…
Reference in New Issue
Block a user