From 41e603b0c3824e9fb62de925c94fe8d5401994b8 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 6 Jun 2021 18:20:04 +0900 Subject: [PATCH] Provide the rpc_response_max_timeout parameter to sriov-agent The rpc_response_max_timeout parameter is used in comminucation over messaging queue, thus should be available for sriov-agent which communicate with neutron-server over messaging queue. Change-Id: Ie6ae31e40488fd8f3d43e83b25e536a7dd9d938c Closes-Bug: #1930996 (cherry picked from commit be43141a5ff6875a146746cb75f927445328c871) (cherry picked from commit 04f4d9d406b186d1fc0bda4fe436a567dbc4b70a) --- neutron/opts.py | 4 ++++ .../plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py | 3 +++ neutron/tests/unit/test_opts.py | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/neutron/opts.py b/neutron/opts.py index c226766e7b5..d3e1e77414d 100644 --- a/neutron/opts.py +++ b/neutron/opts.py @@ -308,6 +308,10 @@ def list_ovs_opts(): def list_sriov_agent_opts(): return [ + ('DEFAULT', + itertools.chain( + neutron.conf.service.RPC_EXTRA_OPTS) + ), ('sriov_nic', neutron.conf.plugins.ml2.drivers.mech_sriov.agent_common. sriov_nic_opts), diff --git a/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py b/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py index cd38b3c5d34..d7a9651a36d 100644 --- a/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py +++ b/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py @@ -44,6 +44,7 @@ from neutron.common import config as common_config from neutron.common import profiler as setup_profiler from neutron.common import utils as n_utils from neutron.conf.agent import common as agent_config +from neutron.conf import service as service_conf from neutron.plugins.ml2.drivers.mech_sriov.agent.common import config from neutron.plugins.ml2.drivers.mech_sriov.agent.common \ import exceptions as exc @@ -548,6 +549,8 @@ def main(): common_config.setup_logging() agent_config.setup_privsep() + service_conf.register_service_opts(service_conf.RPC_EXTRA_OPTS, cfg.CONF) + try: config_parser = SriovNicAgentConfigParser() config_parser.parse() diff --git a/neutron/tests/unit/test_opts.py b/neutron/tests/unit/test_opts.py index cc7be20079f..7cb24bf5f24 100644 --- a/neutron/tests/unit/test_opts.py +++ b/neutron/tests/unit/test_opts.py @@ -21,4 +21,7 @@ from neutron.tests import base class OptsTestCase(base.BaseTestCase): def test_list_sriov_agent_opts(self): - self.assertEqual('sriov_nic', opts.list_sriov_agent_opts()[0][0]) + sriov_agent_opts = opts.list_sriov_agent_opts() + self.assertEqual('DEFAULT', sriov_agent_opts[0][0]) + self.assertEqual('sriov_nic', sriov_agent_opts[1][0]) + self.assertEqual('agent', sriov_agent_opts[2][0])