Use ALLOWED_ADDRESS_PAIR resources constant from neutron_lib
It was introduced in neutron-lib 3.21.0 so it can be used in neutron now. Related-bug: #2116249 Change-Id: I114e14335b9e701981c8ad6e3c846cb4d3cb7fce Signed-off-by: Slawek Kaplonski <skaplons@redhat.com>
This commit is contained in:
@@ -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'],
|
||||
|
@@ -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
|
||||
|
@@ -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),
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user