diff --git a/neutron_lib/plugins/ml2/api.py b/neutron_lib/plugins/ml2/api.py index c6883c901..d559ed785 100644 --- a/neutron_lib/plugins/ml2/api.py +++ b/neutron_lib/plugins/ml2/api.py @@ -76,6 +76,17 @@ class MechanismDriver(object, metaclass=abc.ABCMeta): called prior to this method being called. """ + def start_rpc_listeners(self): + """Start RPC listeners. + + Create and start RPC listeners required by this driver. To be used in + cases where the driver has an agent that requires extra RPC methods to + acquire some data. It is preferred to initialize RPC listeners here + instead of in initialize() to support the split between RPC and API + workers. It works similar to NeutronPluginBaseV2.start_rpc_listeners(). + """ + return [] + def create_network_precommit(self, context): """Allocate resources for a new network. diff --git a/releasenotes/notes/allow-ml2-plugins-to-start-own-rpc-listeners-54f05910ac3f336a.yaml b/releasenotes/notes/allow-ml2-plugins-to-start-own-rpc-listeners-54f05910ac3f336a.yaml new file mode 100644 index 000000000..e2d04ffef --- /dev/null +++ b/releasenotes/notes/allow-ml2-plugins-to-start-own-rpc-listeners-54f05910ac3f336a.yaml @@ -0,0 +1,7 @@ +--- +other: + - | + MechanismDrivers can now start their own RPC listeners by implementing + start_rpc_listeners(). It is preferred to use this method instead of + initialize() for this task to support the split between RPC and + API workers.