diff options
author | Rodolfo Alonso Hernandez <ralonsoh@redhat.com> | 2023-02-03 13:11:24 +0100 |
---|---|---|
committer | Rodolfo Alonso Hernandez <ralonsoh@redhat.com> | 2023-02-08 11:48:48 +0100 |
commit | 47fef55e25fb1b7d3c6c7d6083a916e26fd45b6d (patch) | |
tree | 1dc85e0acfe3f1f296bc58898560adc428787864 /neutron/plugins | |
parent | 0a1cd10570ef9c9aacff4b7b400dd9f4077c8b2c (diff) | |
download | neutron-47fef55e25fb1b7d3c6c7d6083a916e26fd45b6d.tar.gz |
Add a method to retrieve and register "rpc_workers" config knob
This new method retrieves the config option "rpc_workers" from the
configuration. If this option is not loaded, the method registers
the ``neutron.conf.service.SERVICE_OPTS`` options before reading
the knob again.
Closes-Bug: #2004656
Related-Bug: #1889737
Change-Id: I1f99cb32f33cc91141136cb4e3fbd33715530c59
Diffstat (limited to 'neutron/plugins')
-rw-r--r-- | neutron/plugins/ml2/plugin.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py index 616bbed3b2..148b508419 100644 --- a/neutron/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -109,6 +109,7 @@ from neutron.api.rpc.handlers import metadata_rpc from neutron.api.rpc.handlers import resources_rpc from neutron.api.rpc.handlers import securitygroups_rpc from neutron.common import utils +from neutron.conf import service as conf_service from neutron.db import address_group_db from neutron.db import address_scope_db from neutron.db import agents_db @@ -401,7 +402,8 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2, def _start_rpc_notifiers(self): """Initialize RPC notifiers for agents.""" self.ovo_notifier = None - if cfg.CONF.rpc_workers is None or cfg.CONF.rpc_workers >= 1: + rpc_workers = conf_service.get_rpc_workers() + if rpc_workers is None or rpc_workers >= 1: self.ovo_notifier = ovo_rpc.OVOServerRpcInterface() self.notifier = rpc.AgentNotifierApi(topics.AGENT) if cfg.CONF.enable_traditional_dhcp: |