ovn-octavia-provider oslo config options colliding with neutron ones

Bug #1972278 reported by Fernando Royo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Fernando Royo

Bug Description

Some jobs in zuul are reporting this error:

Failed to import test module: ovn_octavia_provider.tests.functional.test_integration
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/home/zuul/src/opendev.org/openstack/ovn-octavia-provider/ovn_octavia_provider/tests/functional/test_integration.py", line 18, in <module>
    from ovn_octavia_provider.tests.functional import base as ovn_base
  File "/home/zuul/src/opendev.org/openstack/ovn-octavia-provider/ovn_octavia_provider/tests/functional/base.py", line 31, in <module>
    from neutron.tests.functional import base
  File "/home/zuul/src/opendev.org/openstack/ovn-octavia-provider/.tox/dsvm-functional/lib/python3.8/site-packages/neutron/tests/functional/base.py", line 40, in <module>
    from neutron.conf.plugins.ml2.drivers.ovn import ovn_conf
  File "/home/zuul/src/opendev.org/openstack/ovn-octavia-provider/.tox/dsvm-functional/lib/python3.8/site-packages/neutron/conf/plugins/ml2/drivers/ovn/ovn_conf.py", line 212, in <module>
    cfg.CONF.register_opts(ovn_opts, group='ovn')
  File "/home/zuul/src/opendev.org/openstack/ovn-octavia-provider/.tox/dsvm-functional/lib/python3.8/site-packages/oslo_config/cfg.py", line 2077, in __inner
...
    if _is_opt_registered(self._opts, opt):
  File "/home/zuul/src/opendev.org/openstack/ovn-octavia-provider/.tox/dsvm-functional/lib/python3.8/site-packages/oslo_config/cfg.py", line 356, in _is_opt_registered
    raise DuplicateOptError(opt.name)
oslo_config.cfg.DuplicateOptError: duplicate option: ovn_nb_connection

Basically the OVN octavia provider is registering opts a soon modules (driver, agent or helper) are imported so when tests run the setUp they are triggered by a Duplicate option error because they are based on TestOVNFunctionalBase from Neutron where same options are loaded. Error doesn't appear in running environment as neutron and ovn-octavia-provider (octavia) are running in separate process but in zuul jobs they collide.

Changed in neutron:
assignee: nobody → Fernando Royo (froyoredhat)
Revision history for this message
Lajos Katona (lajos-katona) wrote :
tags: added: ovn ovn-octavia-provider
Changed in neutron:
status: New → Triaged
Revision history for this message
Lajos Katona (lajos-katona) wrote :

For some reason the bot forgot to add link here for the patch:
https://review.opendev.org/c/openstack/ovn-octavia-provider/+/839083

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to ovn-octavia-provider (master)

Reviewed: https://review.opendev.org/c/openstack/ovn-octavia-provider/+/839083
Committed: https://opendev.org/openstack/ovn-octavia-provider/commit/201e8be0469be0e27d40e720c351cb2a2c095170
Submitter: "Zuul (22348)"
Branch: master

commit 201e8be0469be0e27d40e720c351cb2a2c095170
Author: Fernando Royo <email address hidden>
Date: Fri Apr 22 18:27:22 2022 +0200

    [OVN] Fix DuplicateOptionError on test scope

    OVN Octavia Provider is registering opts a soon modules (driver,
    agent or helper) are imported, so in a test scope terms, when some
    tests run the setUp they are broken by a DuplicateOptionError
    because they are based on TestOVNFunctionalBase from Neutron
    where same options are loaded to same oslo_config group.

    This fix proposes some refactoring in a similar way to [1] and [2]
    in order to avoid the registration of opts a soon a module is
    imported, instead we switch to one charge per required class
    whenever possible.

    Additionally in order to fix gates and according to [3], we pin
    version of OVS to d94cd0d3eec33e4290d7ca81918f5ac61444886e hash

    [1] https://review.opendev.org/c/openstack/neutron/+/837392
    [2] https://review.opendev.org/c/openstack/neutron/+/839783
    [3] https://github.com/ovn-org/ovn/commit/f93206ce40ae38f26ffaf69c5d79a63abfbd5e3c

    Related-Bug: #1972278
    Related-Bug: #1967472

    Change-Id: I2f36af767a0a0a4c19488b6998a414b8672114f5

Changed in neutron:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.