Merge "Use ALLOWED_ADDRESS_PAIR resources constant from neutron_lib"

This commit is contained in:
Zuul
2025-07-23 17:58:53 +00:00
committed by Gerrit Code Review
4 changed files with 5 additions and 11 deletions

View File

@@ -19,6 +19,7 @@ from neutron_lib.api.definitions import port as port_def
from neutron_lib.api import validators
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib.db import api as db_api
from neutron_lib.db import resource_extend
from neutron_lib.db import utils as db_utils
@@ -44,10 +45,8 @@ class AllowedAddressPairsMixin:
'network_id': port['network_id'],
'allowed_address_pairs': allowed_address_pairs,
}
# TODO(slaweq): use constant from neutron_lib.callbacks.resources once
# it will be available and released
registry.publish(
'allowed_address_pair', events.BEFORE_CREATE, self,
resources.ALLOWED_ADDRESS_PAIR, events.BEFORE_CREATE, self,
payload=events.DBEventPayload(
context,
resource_id=port['id'],

View File

@@ -305,10 +305,8 @@ class OVNMechanismDriver(api.MechanismDriver):
registry.subscribe(self.delete_segment_provnet_port,
resources.SEGMENT,
events.AFTER_DELETE)
# TODO(slaweq): use constant from neutron_lib.callbacks.resources once
# it will be available and released
registry.subscribe(self._validate_allowed_address_pairs,
'allowed_address_pair',
resources.ALLOWED_ADDRESS_PAIR,
events.BEFORE_CREATE)
# Handle security group/rule or address group notifications

View File

@@ -1081,10 +1081,7 @@ class L3TestCase(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):
self.mixin, payload=mock.ANY),
mock.call(resources.PORT, events.BEFORE_CREATE,
mock.ANY, payload=mock.ANY),
# TODO(slaweq): use constant from
# neutron_lib.callbacks.resources once it will be available
# and released
mock.call('allowed_address_pair', events.BEFORE_CREATE,
mock.call(resources.ALLOWED_ADDRESS_PAIR, events.BEFORE_CREATE,
mock.ANY, payload=mock.ANY),
mock.call(resources.PORT, events.PRECOMMIT_CREATE,
mock.ANY, payload=mock.ANY),

View File

@@ -15,7 +15,7 @@ requests>=2.32.3 # Apache-2.0
Jinja2>=2.10 # BSD License (3 clause)
keystonemiddleware>=5.1.0 # Apache-2.0
netaddr>=0.7.18 # BSD
neutron-lib>=3.20.0 # Apache-2.0
neutron-lib>=3.21.0 # Apache-2.0
python-neutronclient>=7.8.0 # Apache-2.0
tenacity>=6.0.0 # Apache-2.0
SQLAlchemy>=1.4.23 # MIT