Clean up deprecated sqla model import paths
Those were moved under neutron.db.models start of Ocata. We should be able to clean them up now. NeutronLibImpact Change-Id: Iadbf44d52ee8e30712807384152a29ce1a8b8f72
This commit is contained in:
@ -17,20 +17,15 @@ from oslo_utils import uuidutils
|
||||
|
||||
from neutron._i18n import _
|
||||
from neutron.api.v2 import attributes as attr
|
||||
from neutron.common import _deprecate
|
||||
from neutron.db import _utils as db_utils
|
||||
from neutron.db import api as db_api
|
||||
from neutron.db import db_base_plugin_v2
|
||||
from neutron.db.models import address_scope as address_scope_model
|
||||
from neutron.extensions import address_scope as ext_address_scope
|
||||
from neutron.objects import address_scope as obj_addr_scope
|
||||
from neutron.objects import base as base_obj
|
||||
from neutron.objects import subnetpool as subnetpool_obj
|
||||
|
||||
|
||||
_deprecate._moved_global('AddressScope', new_module=address_scope_model)
|
||||
|
||||
|
||||
class AddressScopeDbMixin(ext_address_scope.AddressScopePluginBase):
|
||||
"""Mixin class to add address scope to db_base_plugin_v2."""
|
||||
|
||||
@ -140,6 +135,3 @@ class AddressScopeDbMixin(ext_address_scope.AddressScopePluginBase):
|
||||
|
||||
db_base_plugin_v2.NeutronDbPluginV2.register_dict_extend_funcs(
|
||||
attr.NETWORKS, ['_extend_network_dict_address_scope'])
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -36,7 +36,6 @@ from neutron.api.rpc.callbacks import version_manager
|
||||
from neutron.callbacks import events
|
||||
from neutron.callbacks import registry
|
||||
from neutron.callbacks import resources
|
||||
from neutron.common import _deprecate
|
||||
from neutron.common import constants as n_const
|
||||
from neutron import context
|
||||
from neutron.db import _utils as db_utils
|
||||
@ -79,9 +78,6 @@ cfg.CONF.register_opts(AGENT_OPTS)
|
||||
DOWNTIME_VERSIONS_RATIO = 2
|
||||
|
||||
|
||||
_deprecate._moved_global('Agent', new_module=agent_model)
|
||||
|
||||
|
||||
class AgentAvailabilityZoneMixin(az_ext.AvailabilityZonePluginBase):
|
||||
"""Mixin class to add availability_zone extension to AgentDbMixin."""
|
||||
|
||||
@ -503,6 +499,3 @@ class AgentExtRpcCallback(object):
|
||||
"%(diff)s seconds, which is more than the "
|
||||
"threshold agent down"
|
||||
"time: %(threshold)s."), log_dict)
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -1,20 +0,0 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron.common import _deprecate
|
||||
from neutron.db.models import allowed_address_pair as aap_models
|
||||
|
||||
|
||||
_deprecate._moved_global('AllowedAddressPair', new_module=aap_models)
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
@ -19,10 +19,8 @@ from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron._i18n import _, _LE
|
||||
from neutron.common import _deprecate
|
||||
from neutron.common import utils
|
||||
from neutron.db import db_base_plugin_v2
|
||||
from neutron.db.models import dns as dns_models
|
||||
from neutron.extensions import dns
|
||||
from neutron.extensions import l3
|
||||
from neutron.objects import floatingip as fip_obj
|
||||
@ -33,11 +31,6 @@ from neutron.services.externaldns import driver
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
_deprecate._moved_global('PortDNS', new_module=dns_models)
|
||||
_deprecate._moved_global('NetworkDNSDomain', new_module=dns_models)
|
||||
_deprecate._moved_global('FloatingIPDNS', new_module=dns_models)
|
||||
|
||||
|
||||
class DNSActionsData(object):
|
||||
|
||||
def __init__(self, current_dns_name=None, current_dns_domain=None,
|
||||
@ -256,6 +249,3 @@ class DNSDbMixin(object):
|
||||
{"name": dns_name,
|
||||
"domain": dns_domain,
|
||||
"message": e.msg})
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -27,7 +27,6 @@ from neutron._i18n import _, _LE
|
||||
from neutron.callbacks import events
|
||||
from neutron.callbacks import registry
|
||||
from neutron.callbacks import resources
|
||||
from neutron.common import _deprecate
|
||||
from neutron.common import utils
|
||||
from neutron.db import api as db_api
|
||||
from neutron.db.models import dvr as dvr_models
|
||||
@ -35,8 +34,6 @@ from neutron.db import models_v2
|
||||
from neutron.extensions import dvr as ext_dvr
|
||||
from neutron.extensions import portbindings
|
||||
|
||||
_deprecate._moved_global('DistributedVirtualRouterMacAddress',
|
||||
new_module=dvr_models)
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@ -220,6 +217,3 @@ class DVRDbMixin(ext_dvr.DVRMacAddressPluginBase):
|
||||
internal_port = internal_gateway_ports[0]
|
||||
subnet_info['gateway_mac'] = internal_port['mac_address']
|
||||
return subnet_info
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -26,7 +26,6 @@ from neutron.callbacks import events
|
||||
from neutron.callbacks import exceptions as c_exc
|
||||
from neutron.callbacks import registry
|
||||
from neutron.callbacks import resources
|
||||
from neutron.common import _deprecate
|
||||
from neutron.db import _utils as db_utils
|
||||
from neutron.db import db_base_plugin_v2
|
||||
from neutron.db.models import external_net as ext_net_models
|
||||
@ -39,8 +38,6 @@ from neutron.extensions import rbac as rbac_ext
|
||||
|
||||
DEVICE_OWNER_ROUTER_GW = constants.DEVICE_OWNER_ROUTER_GW
|
||||
|
||||
_deprecate._moved_global('ExternalNetwork', new_module=ext_net_models)
|
||||
|
||||
|
||||
class External_net_db_mixin(object):
|
||||
"""Mixin class to add external network methods to db_base_plugin_v2."""
|
||||
@ -269,6 +266,3 @@ class External_net_db_mixin(object):
|
||||
new = super(External_net_db_mixin, cls).__new__(cls, *args, **kwargs)
|
||||
new._register_external_net_rbac_hooks()
|
||||
return new
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -19,17 +19,14 @@ from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron._i18n import _
|
||||
from neutron.common import _deprecate
|
||||
from neutron.common import utils
|
||||
from neutron.db import db_base_plugin_v2
|
||||
from neutron.db import l3_db
|
||||
from neutron.db.models import l3 as l3_models
|
||||
from neutron.db import models_v2
|
||||
from neutron.extensions import extraroute
|
||||
from neutron.extensions import l3
|
||||
from neutron.objects import router as l3_obj
|
||||
|
||||
_deprecate._moved_global('RouterRoute', new_module=l3_models)
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@ -168,6 +165,3 @@ class ExtraRoute_dbonly_mixin(l3_db.L3_NAT_dbonly_mixin):
|
||||
class ExtraRoute_db_mixin(ExtraRoute_dbonly_mixin, l3_db.L3_NAT_db_mixin):
|
||||
"""Mixin class to support extra route configuration on router with rpc."""
|
||||
pass
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -15,21 +15,14 @@
|
||||
from oslo_db import exception as db_exc
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron.common import _deprecate
|
||||
from neutron.db import _utils as db_utils
|
||||
from neutron.db import api as db_api
|
||||
from neutron.db import common_db_mixin
|
||||
from neutron.db.models import flavor as flavor_models
|
||||
from neutron.db import servicetype_db as sdb
|
||||
from neutron.extensions import flavors as ext_flavors
|
||||
from neutron.objects import base as base_obj
|
||||
from neutron.objects import flavor as obj_flavor
|
||||
|
||||
_deprecate._moved_global('Flavor', new_module=flavor_models)
|
||||
_deprecate._moved_global('ServiceProfile', new_module=flavor_models)
|
||||
_deprecate._moved_global('FlavorServiceProfileBinding',
|
||||
new_module=flavor_models)
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@ -258,6 +251,3 @@ class FlavorsDbMixin(common_db_mixin.CommonDbMixin):
|
||||
'provider': providers[0].get('name')}
|
||||
|
||||
return [db_utils.resource_fields(res, fields)]
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -29,7 +29,6 @@ from sqlalchemy import sql
|
||||
|
||||
from neutron._i18n import _, _LI
|
||||
from neutron.agent.common import utils as agent_utils
|
||||
from neutron.common import _deprecate
|
||||
from neutron.common import utils as n_utils
|
||||
from neutron.db import agentschedulers_db
|
||||
from neutron.db.models import agent as agent_model
|
||||
@ -40,9 +39,6 @@ from neutron.extensions import l3agentscheduler
|
||||
from neutron.extensions import router_availability_zone as router_az
|
||||
|
||||
|
||||
_deprecate._moved_global('RouterL3AgentBinding',
|
||||
new_module=rb_model)
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ -575,6 +571,3 @@ class AZL3AgentSchedulerDbMixin(L3AgentSchedulerDbMixin,
|
||||
|
||||
def get_router_availability_zones(self, router):
|
||||
return list({agent.availability_zone for agent in router.l3_agents})
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -15,14 +15,11 @@
|
||||
from oslo_config import cfg
|
||||
|
||||
from neutron._i18n import _
|
||||
from neutron.common import _deprecate
|
||||
from neutron.db import db_base_plugin_v2
|
||||
from neutron.db.models import l3_attrs
|
||||
from neutron.extensions import availability_zone as az
|
||||
from neutron.extensions import l3
|
||||
|
||||
_deprecate._moved_global('RouterExtraAttributes', new_module=l3_attrs)
|
||||
|
||||
|
||||
def get_attr_info():
|
||||
"""Returns api visible attr names and their default values."""
|
||||
@ -67,6 +64,3 @@ class ExtraAttributesMixin(object):
|
||||
|
||||
db_base_plugin_v2.NeutronDbPluginV2.register_dict_extend_funcs(
|
||||
l3.ROUTERS, ['_extend_extra_router_dict'])
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -35,7 +35,6 @@ from neutron.callbacks import events
|
||||
from neutron.callbacks import exceptions
|
||||
from neutron.callbacks import registry
|
||||
from neutron.callbacks import resources
|
||||
from neutron.common import _deprecate
|
||||
from neutron.common import constants as n_const
|
||||
from neutron.common import ipv6_utils
|
||||
from neutron.common import rpc as n_rpc
|
||||
@ -55,11 +54,6 @@ from neutron import worker as neutron_worker
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
_deprecate._moved_global('RouterPort', new_module=l3_models)
|
||||
_deprecate._moved_global('Router', new_module=l3_models)
|
||||
_deprecate._moved_global('FloatingIP', new_module=l3_models)
|
||||
|
||||
|
||||
DEVICE_OWNER_HA_REPLICATED_INT = constants.DEVICE_OWNER_HA_REPLICATED_INT
|
||||
DEVICE_OWNER_ROUTER_INTF = constants.DEVICE_OWNER_ROUTER_INTF
|
||||
DEVICE_OWNER_ROUTER_GW = constants.DEVICE_OWNER_ROUTER_GW
|
||||
@ -1957,6 +1951,3 @@ def _notify_subnetpool_address_scope_update(resource, event,
|
||||
)
|
||||
def subscribe():
|
||||
pass
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -34,7 +34,6 @@ from neutron.api.v2 import attributes
|
||||
from neutron.callbacks import events
|
||||
from neutron.callbacks import registry
|
||||
from neutron.callbacks import resources
|
||||
from neutron.common import _deprecate
|
||||
from neutron.common import constants as n_const
|
||||
from neutron.common import utils as n_utils
|
||||
from neutron.db import _utils as db_utils
|
||||
@ -53,10 +52,6 @@ from neutron.extensions import providernet
|
||||
from neutron.plugins.common import utils as p_utils
|
||||
|
||||
|
||||
_deprecate._moved_global('L3HARouterAgentPortBinding', new_module=l3ha_model)
|
||||
_deprecate._moved_global('L3HARouterNetwork', new_module=l3ha_model)
|
||||
_deprecate._moved_global('L3HARouterVRIdAllocation', new_module=l3ha_model)
|
||||
|
||||
VR_ID_RANGE = set(range(1, 255))
|
||||
MAX_ALLOCATION_TRIES = 10
|
||||
UNLIMITED_AGENTS_PER_ROUTER = 0
|
||||
@ -737,6 +732,3 @@ def is_ha_router_port(context, device_owner, router_id):
|
||||
return bool(query.limit(1).count())
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -18,7 +18,6 @@ from oslo_utils import uuidutils
|
||||
from sqlalchemy import orm
|
||||
|
||||
from neutron.api.rpc.agentnotifiers import metering_rpc_agent_api
|
||||
from neutron.common import _deprecate
|
||||
from neutron.common import constants
|
||||
from neutron.db import _utils as db_utils
|
||||
from neutron.db import api as db_api
|
||||
@ -29,10 +28,6 @@ from neutron.db.models import metering as metering_models
|
||||
from neutron.extensions import metering
|
||||
|
||||
|
||||
_deprecate._moved_global('MeteringLabelRule', new_module=metering_models)
|
||||
_deprecate._moved_global('MeteringLabel', new_module=metering_models)
|
||||
|
||||
|
||||
class MeteringDbMixin(metering.MeteringPluginBase,
|
||||
base_db.CommonDbMixin):
|
||||
|
||||
@ -259,6 +254,3 @@ class MeteringDbMixin(metering.MeteringPluginBase,
|
||||
metering_models.MeteringLabel.id == label_id)
|
||||
|
||||
return self._process_sync_metering_data(context, labels)
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -16,7 +16,6 @@
|
||||
from neutron_lib.api import validators
|
||||
|
||||
from neutron.api.v2 import attributes
|
||||
from neutron.common import _deprecate
|
||||
from neutron.db import db_base_plugin_v2
|
||||
from neutron.db.models import portbinding as pmodels
|
||||
from neutron.db import models_v2
|
||||
@ -24,9 +23,6 @@ from neutron.db import portbindings_base
|
||||
from neutron.extensions import portbindings
|
||||
|
||||
|
||||
_deprecate._moved_global('PortBindingPort', new_module=pmodels)
|
||||
|
||||
|
||||
class PortBindingMixin(portbindings_base.PortBindingBaseMixin):
|
||||
extra_binding_dict = None
|
||||
|
||||
@ -109,6 +105,3 @@ def _extend_port_dict_binding(plugin, port_res, port_db):
|
||||
# Register dict extend functions for ports
|
||||
db_base_plugin_v2.NeutronDbPluginV2.register_dict_extend_funcs(
|
||||
attributes.PORTS, [_extend_port_dict_binding])
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -18,9 +18,7 @@ from oslo_log import log as logging
|
||||
from neutron._i18n import _LE
|
||||
from neutron.callbacks import registry
|
||||
from neutron.callbacks import resources
|
||||
from neutron.common import _deprecate
|
||||
from neutron.db import api as db_api
|
||||
from neutron.db.models import provisioning_block as pb_model
|
||||
from neutron.db import models_v2
|
||||
from neutron.objects import provisioning_blocks as pb_obj
|
||||
|
||||
@ -35,8 +33,6 @@ L2_AGENT_ENTITY = 'L2'
|
||||
# to OVO here.
|
||||
_RESOURCE_TO_MODEL_MAP = {resources.PORT: models_v2.Port}
|
||||
|
||||
_deprecate._moved_global('ProvisioningBlock', new_module=pb_model)
|
||||
|
||||
|
||||
def add_model_for_resource(resource, model):
|
||||
"""Adds a mapping between a callback resource and a DB model."""
|
||||
@ -177,6 +173,3 @@ def _get_standard_attr_id(context, object_id, object_type):
|
||||
LOG.debug("Could not find standard attr ID for object %s.", object_id)
|
||||
return
|
||||
return obj.standard_attr_id
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -26,7 +26,6 @@ from neutron.callbacks import events
|
||||
from neutron.callbacks import exceptions
|
||||
from neutron.callbacks import registry
|
||||
from neutron.callbacks import resources
|
||||
from neutron.common import _deprecate
|
||||
from neutron.common import constants as n_const
|
||||
from neutron.common import utils
|
||||
from neutron.db import _utils as db_utils
|
||||
@ -36,11 +35,6 @@ from neutron.db.models import securitygroup as sg_models
|
||||
from neutron.extensions import securitygroup as ext_sg
|
||||
|
||||
|
||||
_deprecate._moved_global('DefaultSecurityGroup', new_module=sg_models)
|
||||
_deprecate._moved_global('SecurityGroupPortBinding', new_module=sg_models)
|
||||
_deprecate._moved_global('SecurityGroupRule', new_module=sg_models)
|
||||
|
||||
|
||||
class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase):
|
||||
"""Mixin class to add security group to db_base_plugin_v2."""
|
||||
|
||||
@ -793,6 +787,3 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase):
|
||||
updated_port[ext_sg.SECURITYGROUPS] = (
|
||||
original_port[ext_sg.SECURITYGROUPS])
|
||||
return need_notify
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -18,11 +18,8 @@ from neutron._i18n import _LI
|
||||
from neutron.callbacks import events
|
||||
from neutron.callbacks import registry
|
||||
from neutron.callbacks import resources
|
||||
from neutron.common import _deprecate
|
||||
from neutron.db.models import segment as segments_model
|
||||
|
||||
_deprecate._moved_global('NetworkSegment', new_module=segments_model)
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
NETWORK_TYPE = segments_model.NetworkSegment.network_type.name
|
||||
@ -128,6 +125,3 @@ def delete_network_segment(context, segment_id):
|
||||
with context.session.begin(subtransactions=True):
|
||||
(context.session.query(segments_model.NetworkSegment).
|
||||
filter_by(id=segment_id).delete())
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -17,15 +17,11 @@ from itertools import chain
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron.common import _deprecate
|
||||
from neutron.db.models import servicetype as st_model
|
||||
from neutron.objects import servicetype as servicetype_obj
|
||||
from neutron.services import provider_configuration as pconf
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
_deprecate._moved_global('ProviderResourceAssociation', new_module=st_model)
|
||||
|
||||
|
||||
class ServiceTypeManager(object):
|
||||
"""Manage service type objects in Neutron."""
|
||||
@ -105,6 +101,3 @@ class ServiceTypeManager(object):
|
||||
return
|
||||
servicetype_obj.ProviderResourceAssociation.delete_objects(
|
||||
context, resource_id=resource_ids)
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -17,12 +17,7 @@
|
||||
# any models at all
|
||||
|
||||
from neutron.api.v2 import attributes
|
||||
from neutron.common import _deprecate
|
||||
from neutron.db import common_db_mixin
|
||||
from neutron.db.models import subnet_service_type as sst_model
|
||||
|
||||
|
||||
_deprecate._moved_global('SubnetServiceType', new_module=sst_model)
|
||||
|
||||
|
||||
class SubnetServiceTypeMixin(object):
|
||||
@ -35,6 +30,3 @@ class SubnetServiceTypeMixin(object):
|
||||
|
||||
common_db_mixin.CommonDbMixin.register_dict_extend_funcs(
|
||||
attributes.SUBNETS, [_extend_subnet_service_types])
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -14,11 +14,8 @@
|
||||
|
||||
from sqlalchemy.orm import aliased
|
||||
|
||||
from neutron.common import _deprecate
|
||||
from neutron.db.models import tag as tag_model
|
||||
|
||||
_deprecate._moved_global('Tag', new_module=tag_model)
|
||||
|
||||
|
||||
def _get_tag_list(tag_strings):
|
||||
tags = set()
|
||||
@ -90,6 +87,3 @@ def apply_tag_filters(model, query, filters):
|
||||
query = query.filter(~model.standard_attr_id.in_(subq))
|
||||
|
||||
return query
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -19,10 +19,8 @@ from oslo_log import log
|
||||
import six
|
||||
|
||||
from neutron._i18n import _, _LI, _LW
|
||||
from neutron.common import _deprecate
|
||||
from neutron.common import exceptions as n_exc
|
||||
from neutron.conf.plugins.ml2.drivers import driver_type
|
||||
from neutron.db.models.plugins.ml2 import flatallocation as type_flat_model
|
||||
from neutron.objects import exceptions as obj_base
|
||||
from neutron.objects.plugins.ml2 import flatallocation as flat_obj
|
||||
from neutron.plugins.common import constants as p_const
|
||||
@ -34,9 +32,6 @@ LOG = log.getLogger(__name__)
|
||||
driver_type.register_ml2_drivers_flat_opts()
|
||||
|
||||
|
||||
_deprecate._moved_global('FlatAllocation', new_module=type_flat_model)
|
||||
|
||||
|
||||
class FlatTypeDriver(helpers.BaseTypeDriver):
|
||||
"""Manage state for flat networks with ML2.
|
||||
|
||||
@ -133,6 +128,3 @@ class FlatTypeDriver(helpers.BaseTypeDriver):
|
||||
if physical_network in self.physnet_mtus:
|
||||
mtu.append(int(self.physnet_mtus[physical_network]))
|
||||
return min(mtu) if mtu else 0
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -19,7 +19,6 @@ from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
||||
from neutron._i18n import _LE
|
||||
from neutron.common import _deprecate
|
||||
from neutron.conf.plugins.ml2.drivers import driver_type
|
||||
from neutron.db.models.plugins.ml2 import geneveallocation \
|
||||
as geneve_model
|
||||
@ -28,9 +27,6 @@ from neutron.plugins.ml2.drivers import type_tunnel
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
_deprecate._moved_global('GeneveAllocation', new_module=geneve_model)
|
||||
_deprecate._moved_global('GeneveEndpoints', new_module=geneve_model)
|
||||
|
||||
driver_type.register_ml2_drivers_geneve_opts()
|
||||
|
||||
|
||||
@ -65,5 +61,3 @@ class GeneveTypeDriver(type_tunnel.EndpointTunnelTypeDriver):
|
||||
def get_mtu(self, physical_network=None):
|
||||
mtu = super(GeneveTypeDriver, self).get_mtu()
|
||||
return mtu - self.max_encap_size if mtu else 0
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -18,7 +18,6 @@ from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
||||
from neutron._i18n import _LE
|
||||
from neutron.common import _deprecate
|
||||
from neutron.conf.plugins.ml2.drivers import driver_type
|
||||
from neutron.db.models.plugins.ml2 import gre_allocation_endpoints as gre_model
|
||||
from neutron.plugins.common import constants as p_const
|
||||
@ -29,10 +28,6 @@ LOG = log.getLogger(__name__)
|
||||
driver_type.register_ml2_drivers_gre_opts()
|
||||
|
||||
|
||||
_deprecate._moved_global('GreAllocation', new_module=gre_model)
|
||||
_deprecate._moved_global('GreEndpoints', new_module=gre_model)
|
||||
|
||||
|
||||
class GreTypeDriver(type_tunnel.EndpointTunnelTypeDriver):
|
||||
|
||||
def __init__(self):
|
||||
@ -63,6 +58,3 @@ class GreTypeDriver(type_tunnel.EndpointTunnelTypeDriver):
|
||||
def get_mtu(self, physical_network=None):
|
||||
mtu = super(GreTypeDriver, self).get_mtu(physical_network)
|
||||
return mtu - p_const.GRE_ENCAP_OVERHEAD if mtu else 0
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -21,7 +21,6 @@ from oslo_log import log
|
||||
from six import moves
|
||||
|
||||
from neutron._i18n import _, _LE, _LI, _LW
|
||||
from neutron.common import _deprecate
|
||||
from neutron.conf.plugins.ml2.drivers import driver_type
|
||||
from neutron import context
|
||||
from neutron.db import api as db_api
|
||||
@ -33,8 +32,6 @@ from neutron.plugins.ml2.drivers import helpers
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
_deprecate._moved_global('VlanAllocation', new_module=vlan_alloc_model)
|
||||
|
||||
driver_type.register_ml2_drivers_vlan_opts()
|
||||
|
||||
|
||||
@ -236,6 +233,3 @@ class VlanTypeDriver(helpers.SegmentTypeDriver):
|
||||
if physical_network in self.physnet_mtus:
|
||||
mtu.append(int(self.physnet_mtus[physical_network]))
|
||||
return min(mtu) if mtu else 0
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -18,7 +18,6 @@ from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
||||
from neutron._i18n import _LE
|
||||
from neutron.common import _deprecate
|
||||
from neutron.conf.plugins.ml2.drivers import driver_type
|
||||
from neutron.db.models.plugins.ml2 import vxlanallocation as vxlan_model
|
||||
from neutron.plugins.common import constants as p_const
|
||||
@ -26,9 +25,6 @@ from neutron.plugins.ml2.drivers import type_tunnel
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
_deprecate._moved_global('VxlanAllocation', new_module=vxlan_model)
|
||||
_deprecate._moved_global('VxlanEndpoints', new_module=vxlan_model)
|
||||
|
||||
driver_type.register_ml2_drivers_vxlan_opts()
|
||||
|
||||
|
||||
@ -63,5 +59,3 @@ class VxlanTypeDriver(type_tunnel.EndpointTunnelTypeDriver):
|
||||
def get_mtu(self, physical_network=None):
|
||||
mtu = super(VxlanTypeDriver, self).get_mtu()
|
||||
return mtu - p_const.VXLAN_ENCAP_OVERHEAD if mtu else 0
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -28,7 +28,6 @@ from sqlalchemy.orm import exc
|
||||
from neutron.callbacks import events
|
||||
from neutron.callbacks import registry
|
||||
from neutron.callbacks import resources
|
||||
from neutron.common import _deprecate
|
||||
from neutron.db import _utils as db_utils
|
||||
from neutron.db import api as db_api
|
||||
from neutron.db import common_db_mixin
|
||||
@ -39,8 +38,6 @@ from neutron import manager
|
||||
from neutron.objects import network
|
||||
from neutron.services.segments import exceptions
|
||||
|
||||
_deprecate._moved_global('SegmentHostMapping', new_module=segment_model)
|
||||
|
||||
|
||||
class SegmentDbMixin(common_db_mixin.CommonDbMixin):
|
||||
"""Mixin class to add segment."""
|
||||
@ -330,6 +327,3 @@ def subscribe():
|
||||
events.PRECOMMIT_DELETE)
|
||||
|
||||
subscribe()
|
||||
|
||||
|
||||
_deprecate._MovedGlobals()
|
||||
|
@ -30,6 +30,7 @@ from neutron.callbacks import registry
|
||||
from neutron.callbacks import resources
|
||||
from neutron.common import exceptions as n_exc
|
||||
from neutron.db import common_db_mixin
|
||||
from neutron.db.models import segment as segment_model
|
||||
from neutron.db import models_v2
|
||||
from neutron.extensions import ip_allocation
|
||||
from neutron.extensions import l2_adjacency
|
||||
@ -187,8 +188,10 @@ class NovaSegmentNotifier(object):
|
||||
return
|
||||
total, reserved = self._calculate_inventory_total_and_reserved(subnet)
|
||||
if total:
|
||||
query = context.session.query(
|
||||
db.SegmentHostMapping).filter_by(segment_id=segment_id)
|
||||
query = (
|
||||
context.session.query(segment_model.SegmentHostMapping).
|
||||
filter_by(segment_id=segment_id)
|
||||
)
|
||||
self.batch_notifier.queue_event(Event(
|
||||
self._create_or_update_nova_inventory, segment_id, total=total,
|
||||
reserved=reserved, segment_host_mappings=query.all()))
|
||||
@ -275,7 +278,7 @@ class NovaSegmentNotifier(object):
|
||||
segment_host_mappings = None
|
||||
if not original_subnet['allocation_pools']:
|
||||
segment_host_mappings = context.session.query(
|
||||
db.SegmentHostMapping).filter_by(
|
||||
segment_model.SegmentHostMapping).filter_by(
|
||||
segment_id=segment_id).all()
|
||||
self.batch_notifier.queue_event(Event(
|
||||
self._create_or_update_nova_inventory, segment_id, total=total,
|
||||
|
Reference in New Issue
Block a user