Merge "Use neutron-lib standard_attr"
This commit is contained in:
commit
f1d0558626
@ -13,11 +13,11 @@
|
|||||||
from neutron_lib.api.definitions import address_group as ag
|
from neutron_lib.api.definitions import address_group as ag
|
||||||
from neutron_lib.db import constants as db_const
|
from neutron_lib.db import constants as db_const
|
||||||
from neutron_lib.db import model_base
|
from neutron_lib.db import model_base
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
|
|
||||||
from neutron.db import rbac_db_models
|
from neutron.db import rbac_db_models
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
|
|
||||||
class AddressAssociation(model_base.BASEV2):
|
class AddressAssociation(model_base.BASEV2):
|
||||||
|
@ -13,12 +13,12 @@
|
|||||||
from neutron_lib.api.definitions import l3 as l3_apidef
|
from neutron_lib.api.definitions import l3 as l3_apidef
|
||||||
from neutron_lib.db import constants as db_const
|
from neutron_lib.db import constants as db_const
|
||||||
from neutron_lib.db import model_base
|
from neutron_lib.db import model_base
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
|
|
||||||
from neutron.db.models import l3agent as rb_model
|
from neutron.db.models import l3agent as rb_model
|
||||||
from neutron.db import models_v2
|
from neutron.db import models_v2
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
|
|
||||||
class RouterPort(model_base.BASEV2):
|
class RouterPort(model_base.BASEV2):
|
||||||
|
@ -15,10 +15,9 @@
|
|||||||
|
|
||||||
from neutron_lib.db import constants as db_const
|
from neutron_lib.db import constants as db_const
|
||||||
from neutron_lib.db import model_base
|
from neutron_lib.db import model_base
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
|
|
||||||
class Log(standard_attr.HasStandardAttributes, model_base.BASEV2,
|
class Log(standard_attr.HasStandardAttributes, model_base.BASEV2,
|
||||||
model_base.HasId, model_base.HasProject):
|
model_base.HasId, model_base.HasProject):
|
||||||
|
@ -16,10 +16,9 @@ from neutron_lib.api.definitions import network_segment_range as range_apidef
|
|||||||
from neutron_lib import constants
|
from neutron_lib import constants
|
||||||
from neutron_lib.db import constants as db_const
|
from neutron_lib.db import constants as db_const
|
||||||
from neutron_lib.db import model_base
|
from neutron_lib.db import model_base
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
|
|
||||||
class NetworkSegmentRange(standard_attr.HasStandardAttributes,
|
class NetworkSegmentRange(standard_attr.HasStandardAttributes,
|
||||||
model_base.BASEV2, model_base.HasId,
|
model_base.BASEV2, model_base.HasId,
|
||||||
|
@ -14,12 +14,12 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from neutron_lib.db import model_base
|
from neutron_lib.db import model_base
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
|
|
||||||
from neutron.db.models import l3
|
from neutron.db.models import l3
|
||||||
from neutron.db import models_v2
|
from neutron.db import models_v2
|
||||||
from neutron.db import standard_attr
|
|
||||||
from neutron_lib.api.definitions import fip_pf_description as apidef
|
from neutron_lib.api.definitions import fip_pf_description as apidef
|
||||||
from neutron_lib.db import constants as db_const
|
from neutron_lib.db import constants as db_const
|
||||||
|
|
||||||
|
@ -11,10 +11,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from neutron_lib.db import model_base
|
from neutron_lib.db import model_base
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
|
|
||||||
class ProvisioningBlock(model_base.BASEV2):
|
class ProvisioningBlock(model_base.BASEV2):
|
||||||
# the standard attr id of the thing we want to block
|
# the standard attr id of the thing we want to block
|
||||||
|
@ -14,13 +14,13 @@
|
|||||||
|
|
||||||
from neutron_lib.db import constants as db_const
|
from neutron_lib.db import constants as db_const
|
||||||
from neutron_lib.db import model_base
|
from neutron_lib.db import model_base
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
from sqlalchemy import sql
|
from sqlalchemy import sql
|
||||||
|
|
||||||
from neutron.db import models_v2
|
from neutron.db import models_v2
|
||||||
from neutron.db import rbac_db_models
|
from neutron.db import rbac_db_models
|
||||||
from neutron.db import standard_attr
|
|
||||||
from neutron.extensions import securitygroup as sg
|
from neutron.extensions import securitygroup as sg
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,11 +16,11 @@
|
|||||||
|
|
||||||
from neutron_lib.db import constants as db_const
|
from neutron_lib.db import constants as db_const
|
||||||
from neutron_lib.db import model_base
|
from neutron_lib.db import model_base
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
|
|
||||||
from neutron.db import models_v2
|
from neutron.db import models_v2
|
||||||
from neutron.db import standard_attr
|
|
||||||
from neutron.extensions import segment
|
from neutron.extensions import segment
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,11 +13,10 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
from neutron_lib.db import model_base
|
from neutron_lib.db import model_base
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
|
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
|
|
||||||
class Tag(model_base.BASEV2):
|
class Tag(model_base.BASEV2):
|
||||||
standard_attr_id = sa.Column(
|
standard_attr_id = sa.Column(
|
||||||
|
@ -20,13 +20,13 @@ from neutron_lib.api.definitions import subnetpool as subnetpool_def
|
|||||||
from neutron_lib import constants
|
from neutron_lib import constants
|
||||||
from neutron_lib.db import constants as db_const
|
from neutron_lib.db import constants as db_const
|
||||||
from neutron_lib.db import model_base
|
from neutron_lib.db import model_base
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
from sqlalchemy import sql
|
from sqlalchemy import sql
|
||||||
|
|
||||||
from neutron.db.network_dhcp_agent_binding import models as ndab_model
|
from neutron.db.network_dhcp_agent_binding import models as ndab_model
|
||||||
from neutron.db import rbac_db_models
|
from neutron.db import rbac_db_models
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
|
|
||||||
# NOTE(ralonsoh): move to neutron_lib.db.model_base
|
# NOTE(ralonsoh): move to neutron_lib.db.model_base
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from neutron_lib.db import api as db_api
|
from neutron_lib.db import api as db_api
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
from neutron_lib import exceptions as n_exc
|
from neutron_lib import exceptions as n_exc
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
@ -28,7 +29,6 @@ from neutron.db.models import l3 # noqa
|
|||||||
from neutron.db.models import ovn as ovn_models
|
from neutron.db.models import ovn as ovn_models
|
||||||
from neutron.db.models import securitygroup # noqa
|
from neutron.db.models import securitygroup # noqa
|
||||||
from neutron.db import models_v2 # noqa
|
from neutron.db import models_v2 # noqa
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
|
@ -16,12 +16,12 @@
|
|||||||
from neutron_lib import constants
|
from neutron_lib import constants
|
||||||
from neutron_lib.db import constants as db_const
|
from neutron_lib.db import constants as db_const
|
||||||
from neutron_lib.db import model_base
|
from neutron_lib.db import model_base
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
from neutron.db.models import l3
|
from neutron.db.models import l3
|
||||||
from neutron.db import models_v2
|
from neutron.db import models_v2
|
||||||
from neutron.db import rbac_db_models
|
from neutron.db import rbac_db_models
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
|
|
||||||
class QosPolicy(standard_attr.HasStandardAttributes, model_base.BASEV2,
|
class QosPolicy(standard_attr.HasStandardAttributes, model_base.BASEV2,
|
||||||
|
@ -1,23 +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_lib.db import standard_attr
|
|
||||||
|
|
||||||
|
|
||||||
# TODO(boden): remove shims when all consumers use lib for this module
|
|
||||||
StandardAttribute = standard_attr.StandardAttribute
|
|
||||||
HasStandardAttributes = standard_attr.HasStandardAttributes
|
|
||||||
get_standard_attr_resource_model_map = (
|
|
||||||
standard_attr.get_standard_attr_resource_model_map)
|
|
||||||
get_tag_resource_parent_map = standard_attr.get_tag_resource_parent_map
|
|
@ -13,8 +13,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from neutron_lib.db import resource_extend
|
from neutron_lib.db import resource_extend
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
|
|
||||||
@resource_extend.has_resource_extenders
|
@resource_extend.has_resource_extenders
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
from neutron.db import standard_attr
|
from neutron_lib.db import standard_attr
|
||||||
|
|
||||||
|
|
||||||
def stdattrs_extended_resources(attributes):
|
def stdattrs_extended_resources(attributes):
|
||||||
|
@ -18,6 +18,7 @@ from neutron_lib.api.definitions import port
|
|||||||
from neutron_lib.api import extensions as api_extensions
|
from neutron_lib.api import extensions as api_extensions
|
||||||
from neutron_lib.api import faults
|
from neutron_lib.api import faults
|
||||||
from neutron_lib.api import validators
|
from neutron_lib.api import validators
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
from neutron_lib import exceptions
|
from neutron_lib import exceptions
|
||||||
from neutron_lib.plugins import directory
|
from neutron_lib.plugins import directory
|
||||||
from neutron_lib import rpc as n_rpc
|
from neutron_lib import rpc as n_rpc
|
||||||
@ -27,7 +28,6 @@ import webob.exc
|
|||||||
from neutron._i18n import _
|
from neutron._i18n import _
|
||||||
from neutron.api import extensions
|
from neutron.api import extensions
|
||||||
from neutron.api.v2 import resource as api_resource
|
from neutron.api.v2 import resource as api_resource
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
|
|
||||||
TAG = 'tag'
|
TAG = 'tag'
|
||||||
|
@ -18,6 +18,7 @@ import functools
|
|||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
from neutron_lib.db import api as db_api
|
from neutron_lib.db import api as db_api
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
from neutron_lib import exceptions as n_exc
|
from neutron_lib import exceptions as n_exc
|
||||||
from neutron_lib.objects import exceptions as o_exc
|
from neutron_lib.objects import exceptions as o_exc
|
||||||
from neutron_lib.objects.extensions import standardattributes
|
from neutron_lib.objects.extensions import standardattributes
|
||||||
@ -34,7 +35,6 @@ from sqlalchemy import orm
|
|||||||
from sqlalchemy.orm import query as sqla_query
|
from sqlalchemy.orm import query as sqla_query
|
||||||
|
|
||||||
from neutron._i18n import _
|
from neutron._i18n import _
|
||||||
from neutron.db import standard_attr
|
|
||||||
from neutron.objects.db import api as obj_db_api
|
from neutron.objects.db import api as obj_db_api
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,10 +10,10 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
from neutron_lib.objects.extensions import standardattributes as stdattr_obj
|
from neutron_lib.objects.extensions import standardattributes as stdattr_obj
|
||||||
from oslo_versionedobjects import fields as obj_fields
|
from oslo_versionedobjects import fields as obj_fields
|
||||||
|
|
||||||
from neutron.db import standard_attr
|
|
||||||
from neutron.objects import base
|
from neutron.objects import base
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,12 +13,12 @@
|
|||||||
import functools
|
import functools
|
||||||
|
|
||||||
from neutron_lib.db import model_query
|
from neutron_lib.db import model_query
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
from sqlalchemy.orm import aliased
|
from sqlalchemy.orm import aliased
|
||||||
|
|
||||||
from oslo_versionedobjects import fields as obj_fields
|
from oslo_versionedobjects import fields as obj_fields
|
||||||
|
|
||||||
from neutron.db.models import tag as tag_model
|
from neutron.db.models import tag as tag_model
|
||||||
from neutron.db import standard_attr
|
|
||||||
from neutron.objects import base
|
from neutron.objects import base
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
from neutron_lib.api.definitions import revisionifmatch
|
from neutron_lib.api.definitions import revisionifmatch
|
||||||
from neutron_lib.db import api as db_api
|
from neutron_lib.db import api as db_api
|
||||||
from neutron_lib.db import resource_extend
|
from neutron_lib.db import resource_extend
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
from neutron_lib.services import base as service_base
|
from neutron_lib.services import base as service_base
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
@ -22,7 +23,6 @@ from sqlalchemy.orm import session as se
|
|||||||
import webob.exc
|
import webob.exc
|
||||||
|
|
||||||
from neutron._i18n import _
|
from neutron._i18n import _
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -15,12 +15,12 @@
|
|||||||
from neutron_lib.db import api as db_api
|
from neutron_lib.db import api as db_api
|
||||||
from neutron_lib.db import model_query
|
from neutron_lib.db import model_query
|
||||||
from neutron_lib.db import resource_extend
|
from neutron_lib.db import resource_extend
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
from neutron_lib.objects import exceptions as obj_exc
|
from neutron_lib.objects import exceptions as obj_exc
|
||||||
from neutron_lib.plugins import directory
|
from neutron_lib.plugins import directory
|
||||||
from oslo_log import helpers as log_helpers
|
from oslo_log import helpers as log_helpers
|
||||||
from sqlalchemy.orm import exc
|
from sqlalchemy.orm import exc
|
||||||
|
|
||||||
from neutron.db import standard_attr
|
|
||||||
from neutron.extensions import tagging
|
from neutron.extensions import tagging
|
||||||
from neutron.objects import tag as tag_obj
|
from neutron.objects import tag as tag_obj
|
||||||
|
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
from neutron_lib.db import api as db_api
|
from neutron_lib.db import api as db_api
|
||||||
from neutron_lib.db import model_query
|
from neutron_lib.db import model_query
|
||||||
from neutron_lib.db import resource_extend
|
from neutron_lib.db import resource_extend
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
from neutron_lib import exceptions as n_exc
|
from neutron_lib import exceptions as n_exc
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
from sqlalchemy.orm import session as se
|
from sqlalchemy.orm import session as se
|
||||||
|
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
CHANGED_SINCE = 'changed_since'
|
CHANGED_SINCE = 'changed_since'
|
||||||
TIME_FORMAT_WHOLE_SECONDS = '%Y-%m-%dT%H:%M:%S'
|
TIME_FORMAT_WHOLE_SECONDS = '%Y-%m-%dT%H:%M:%S'
|
||||||
|
@ -15,12 +15,12 @@
|
|||||||
|
|
||||||
from neutron_lib.db import constants as db_const
|
from neutron_lib.db import constants as db_const
|
||||||
from neutron_lib.db import model_base
|
from neutron_lib.db import model_base
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
from neutron_lib.services.trunk import constants
|
from neutron_lib.services.trunk import constants
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import sql
|
from sqlalchemy import sql
|
||||||
|
|
||||||
from neutron.db import models_v2
|
from neutron.db import models_v2
|
||||||
from neutron.db import standard_attr
|
|
||||||
|
|
||||||
|
|
||||||
class Trunk(standard_attr.HasStandardAttributes, model_base.BASEV2,
|
class Trunk(standard_attr.HasStandardAttributes, model_base.BASEV2,
|
||||||
|
@ -27,6 +27,7 @@ from neutron_lib.callbacks import registry
|
|||||||
from neutron_lib import constants
|
from neutron_lib import constants
|
||||||
from neutron_lib import context
|
from neutron_lib import context
|
||||||
from neutron_lib.db import api as db_api
|
from neutron_lib.db import api as db_api
|
||||||
|
from neutron_lib.db import standard_attr
|
||||||
from neutron_lib import exceptions as lib_exc
|
from neutron_lib import exceptions as lib_exc
|
||||||
from neutron_lib import fixture
|
from neutron_lib import fixture
|
||||||
from neutron_lib.plugins import directory
|
from neutron_lib.plugins import directory
|
||||||
@ -57,7 +58,6 @@ from neutron.db import ipam_backend_mixin
|
|||||||
from neutron.db.models import l3 as l3_models
|
from neutron.db.models import l3 as l3_models
|
||||||
from neutron.db.models import securitygroup as sg_models
|
from neutron.db.models import securitygroup as sg_models
|
||||||
from neutron.db import models_v2
|
from neutron.db import models_v2
|
||||||
from neutron.db import standard_attr
|
|
||||||
from neutron.ipam.drivers.neutrondb_ipam import driver as ipam_driver
|
from neutron.ipam.drivers.neutrondb_ipam import driver as ipam_driver
|
||||||
from neutron.ipam import exceptions as ipam_exc
|
from neutron.ipam import exceptions as ipam_exc
|
||||||
from neutron.objects import network as network_obj
|
from neutron.objects import network as network_obj
|
||||||
|
Loading…
Reference in New Issue
Block a user