From 1e4c529e53d5a210e608398f3b6bc691882a7e91 Mon Sep 17 00:00:00 2001 From: Thales Elero Cervi Date: Wed, 22 Feb 2023 13:47:27 -0300 Subject: [PATCH] Move register_opts from pci to manager module Follow-up change on [1] that moves the configuration register_opts directly into manager.py to prevent sysinv.manager from ending up attempting to run register_opts twice in cases where the pci modulee is imported several times. [1] https://review.opendev.org/c/starlingx/config/+/872979 TEST PLAN: PASS - Build sysinv*.deb packages PASS - Bootstrap an AIO-SX system with new package Story: 2010317 Task: 46389 Signed-off-by: Thales Elero Cervi Change-Id: Ib583f43b5cc612932c1aad9cff1f81d9f9cd294c --- sysinv/sysinv/sysinv/sysinv/agent/manager.py | 7 +++++++ sysinv/sysinv/sysinv/sysinv/agent/pci.py | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/sysinv/sysinv/sysinv/sysinv/agent/manager.py b/sysinv/sysinv/sysinv/sysinv/agent/manager.py index d2ae0d53f5..9086abeaae 100644 --- a/sysinv/sysinv/sysinv/sysinv/agent/manager.py +++ b/sysinv/sysinv/sysinv/sysinv/agent/manager.py @@ -96,9 +96,16 @@ audit_intervals_opts = [ cfg.IntOpt('lldp_audit', default=300) ] +dpdk_opts = [ + cfg.StrOpt('dpdk_elf', + default='/usr/sbin/ovs-vswitchd', + help='DPDK ELF file used for compatibility checks'), + ] + CONF = cfg.CONF CONF.register_opts(agent_opts, 'agent') CONF.register_opts(audit_intervals_opts, 'agent_periodic_task_intervals') +CONF.register_opts(dpdk_opts, 'dpdk') MAXSLEEP = 600 # 10 minutes diff --git a/sysinv/sysinv/sysinv/sysinv/agent/pci.py b/sysinv/sysinv/sysinv/sysinv/agent/pci.py index 4164cf9f6f..8c6e2be727 100644 --- a/sysinv/sysinv/sysinv/sysinv/agent/pci.py +++ b/sysinv/sysinv/sysinv/sysinv/agent/pci.py @@ -24,15 +24,7 @@ from sysinv.common import constants from sysinv.common import device as dconstants from sysinv.common import utils -dpdk_opts = [ - cfg.StrOpt('dpdk_elf', - default='/usr/sbin/ovs-vswitchd', - help='DPDK ELF file used for compatibility checks'), - ] - CONF = cfg.CONF -CONF.register_opts(dpdk_opts, 'dpdk') - LOG = logging.getLogger(__name__) # Look for PCI class 0x0200 and 0x0280 so that we get generic ethernet