Work around DbBasePluginCommon._get_subnet removal
The upstream commit [0] removed the _get_subnet method from the common DB plugin. However, this method is still in use by the group-based-policy project. As a workaround, we re-add this method to our specialization of the core plugin. This should be replaced at some point by a method that follows upstream. [0]: //review.opendev.org/c/openstack/neutron/+/742829. Change-Id: I64615d499cca206a840a6d70477513132077fd50
This commit is contained in:
parent
7fa521d0b2
commit
87aa7dd4cb
@ -35,11 +35,14 @@ from neutron_lib.callbacks import events
|
||||
from neutron_lib.callbacks import registry
|
||||
from neutron_lib.callbacks import resources
|
||||
from neutron_lib import constants as n_const
|
||||
from neutron_lib.db import model_query
|
||||
from neutron_lib.db import resource_extend
|
||||
from neutron_lib.db import utils as db_utils
|
||||
from neutron_lib import exceptions
|
||||
from neutron_lib.plugins import directory
|
||||
from oslo_log import log
|
||||
from oslo_utils import excutils
|
||||
from sqlalchemy.orm import exc
|
||||
|
||||
from gbpservice.neutron.db import api as db_api
|
||||
from gbpservice.neutron.db import implicitsubnetpool_db
|
||||
@ -632,6 +635,17 @@ class Ml2PlusPlugin(ml2_plugin.Ml2Plugin,
|
||||
|
||||
return result
|
||||
|
||||
# REVISIT: workaround due to the change in
|
||||
# https://review.opendev.org/c/openstack/neutron/+/742829.
|
||||
def _get_subnet(self, context, id):
|
||||
# TODO(slaweq): remove this method when all will be switched to use OVO
|
||||
# objects only
|
||||
try:
|
||||
subnet = model_query.get_by_id(context, models_v2.Subnet, id)
|
||||
except exc.NoResultFound:
|
||||
raise exceptions.SubnetNotFound(subnet_id=id)
|
||||
return subnet
|
||||
|
||||
@db_api.retry_if_session_inactive()
|
||||
def get_subnets(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
|
@ -10,7 +10,7 @@ neutron
|
||||
python-heatclient
|
||||
python-keystoneclient
|
||||
|
||||
-e git+https://opendev.org/openstack/networking-sfc.git@stable/victoria#egg=networking-sfc
|
||||
-e git+https://opendev.org/openstack/networking-sfc.git@unmaintained/victoria#egg=networking-sfc
|
||||
|
||||
-e git+https://github.com/noironetworks/apicapi.git@master#egg=apicapi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user