Check if plugin supports starting rpc listeners

When neutron starts an rpc worker, it checks if the plugin has the method
"start_rpc_listeners".  Since most plugins inherit from a base class, and
that base class implements the start_rpc_listeners method and raises
NotImplementedError, the rpc worker will attempt to call that method.
It should just catch the NotImplementedError and continue on.

Change-Id: Ie1830b6140acffffd0f283a0d8eefa52067f7650
Closes-Bug: 1551542
This commit is contained in:
Brandon Logan 2016-02-29 23:11:18 -06:00
parent 85abeded9e
commit cd7be292a8
1 changed files with 4 additions and 1 deletions

View File

@ -139,7 +139,10 @@ class RpcWorker(worker.NeutronWorker):
super(RpcWorker, self).start()
for plugin in self._plugins:
if hasattr(plugin, self.start_listeners_method):
servers = getattr(plugin, self.start_listeners_method)()
try:
servers = getattr(plugin, self.start_listeners_method)()
except NotImplementedError:
continue
self._servers.extend(servers)
def wait(self):