diff --git a/vmware_nsx/db/extended_security_group.py b/vmware_nsx/db/extended_security_group.py index 2885863d08..f6d9ae3ba6 100644 --- a/vmware_nsx/db/extended_security_group.py +++ b/vmware_nsx/db/extended_security_group.py @@ -55,7 +55,7 @@ class NsxExtendedSecurityGroupProperties(model_base.BASEV2): nullable=False) policy = sa.Column(sa.String(36)) security_group = orm.relationship( - securitygroups_db.SecurityGroup, + 'neutron.db.models.securitygroup.SecurityGroup', backref=orm.backref('ext_properties', lazy='joined', uselist=False, cascade='delete')) diff --git a/vmware_nsx/db/extended_security_group_rule.py b/vmware_nsx/db/extended_security_group_rule.py index fc39dd209e..1b8d8b45fd 100644 --- a/vmware_nsx/db/extended_security_group_rule.py +++ b/vmware_nsx/db/extended_security_group_rule.py @@ -19,7 +19,6 @@ from sqlalchemy import orm from neutron.db import _resource_extend as resource_extend from neutron.db import api as db_api -from neutron.db.models import securitygroup from neutron.extensions import securitygroup as ext_sg from neutron_lib.api import validators from neutron_lib import exceptions as nexception @@ -47,7 +46,7 @@ class NsxExtendedSecurityGroupRuleProperties(model_base.BASEV2): local_ip_prefix = sa.Column(sa.String(255), nullable=False) rule = orm.relationship( - securitygroup.SecurityGroupRule, + 'neutron.db.models.securitygroup.SecurityGroupRule', backref=orm.backref('ext_properties', lazy='joined', uselist=False, cascade='delete')) diff --git a/vmware_nsx/db/nsx_models.py b/vmware_nsx/db/nsx_models.py index 82e7aacb66..8b422bc9db 100644 --- a/vmware_nsx/db/nsx_models.py +++ b/vmware_nsx/db/nsx_models.py @@ -261,7 +261,7 @@ class MacLearningState(model_base.BASEV2, models.TimestampMixin): # Add a relationship to the Port model using the backref attribute. # This will instruct SQLAlchemy to eagerly load this association. port = orm.relationship( - models_v2.Port, + 'neutron.db.models_v2.Port', backref=orm.backref("mac_learning_state", lazy='joined', uselist=False, cascade='delete')) @@ -318,7 +318,7 @@ class PortQueueMapping(model_base.BASEV2, models.TimestampMixin): # Add a relationship to the Port model adding a backref which will # allow SQLAlchemy for eagerly load the queue binding port = orm.relationship( - models_v2.Port, + 'neutron.db.models_v2.Port', backref=orm.backref("qos_queue", uselist=False, cascade='delete', lazy='joined')) @@ -334,7 +334,7 @@ class NetworkQueueMapping(model_base.BASEV2, models.TimestampMixin): # Add a relationship to the Network model adding a backref which will # allow SQLAlcremy for eagerly load the queue binding network = orm.relationship( - models_v2.Network, + 'neutron.db.models_v2.Network', backref=orm.backref("qos_queue", uselist=False, cascade='delete', lazy='joined')) diff --git a/vmware_nsx/db/nsxv_models.py b/vmware_nsx/db/nsxv_models.py index 9b5ae70a14..ff7df3e792 100644 --- a/vmware_nsx/db/nsxv_models.py +++ b/vmware_nsx/db/nsxv_models.py @@ -19,8 +19,6 @@ from neutron_lib.db import model_base import sqlalchemy as sa from sqlalchemy import orm -from neutron.db.models import l3 as l3_db -from neutron.db import models_v2 from oslo_db.sqlalchemy import models from vmware_nsx.common import nsxv_constants @@ -164,7 +162,7 @@ class NsxvRouterExtAttributes(model_base.BASEV2, models.TimestampMixin): # Add a relationship to the Router model in order to instruct # SQLAlchemy to eagerly load this association router = orm.relationship( - l3_db.Router, + 'neutron.db.models.l3.Router', backref=orm.backref("nsx_attributes", lazy='joined', uselist=False, cascade='delete')) @@ -218,7 +216,7 @@ class NsxvPortIndexMapping(model_base.BASEV2, models.TimestampMixin): # Add a relationship to the Port model in order to instruct SQLAlchemy to # eagerly read port vnic-index port = orm.relationship( - models_v2.Port, + 'neutron.db.models_v2.Port', backref=orm.backref("vnic_index", lazy='joined', uselist=False, cascade='delete')) @@ -344,7 +342,7 @@ class NsxvSubnetExtAttributes(model_base.BASEV2, models.TimestampMixin): # Add a relationship to the Subnet model in order to instruct # SQLAlchemy to eagerly load this association subnet = orm.relationship( - models_v2.Subnet, + 'neutron.db.models_v2.Subnet', backref=orm.backref("nsxv_subnet_attributes", lazy='joined', uselist=False, cascade='delete')) @@ -363,7 +361,7 @@ class NsxvPortExtAttributes(model_base.BASEV2, models.TimestampMixin): # Add a relationship to the port model in order to instruct # SQLAlchemy to eagerly load this association port = orm.relationship( - models_v2.Port, + 'neutron.db.models_v2.Port', backref=orm.backref("nsx_port_attributes", lazy='joined', uselist=False, cascade='delete'))