Register common config options in ``MechDriverSetupBase``

When manually testing any ``MechDriverSetupBase`` child testing class,
the following error is shown:
  oslo_config.cfg.NoSuchOptError: no such option service_plugins in
  group [DEFAULT]

To avoid this, this patch registers the common config options during the
``MechDriverSetupBase`` setup method. The
``register_common_config_options`` will not register the options if are
alredy registered.

Related-Bug: #1968606
Change-Id: Ie324b8489e2826a9f82fc9b45ee9684a680c6a8b
This commit is contained in:
Rodolfo Alonso Hernandez 2022-05-12 18:05:20 +00:00
parent 182044d628
commit 44c03ca8e1
1 changed files with 2 additions and 0 deletions

View File

@ -43,6 +43,7 @@ from oslo_utils import uuidutils
from ovsdbapp.backend.ovs_idl import idlutils
from webob import exc
from neutron.common import config
from neutron.common.ovn import acl as ovn_acl
from neutron.common.ovn import constants as ovn_const
from neutron.common.ovn import exceptions as ovn_exceptions
@ -76,6 +77,7 @@ OvnRevNumberRow = collections.namedtuple(
class MechDriverSetupBase:
def setUp(self):
config.register_common_config_options()
super().setUp()
mm = directory.get_plugin().mechanism_manager
self.mech_driver = mm.mech_drivers['ovn'].obj