]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Vmware: Set correct nullable for lsn_id, nsx_port_id
authorAnn Kamyshnikova <akamyshnikova@mirantis.com>
Tue, 22 Apr 2014 07:40:36 +0000 (11:40 +0400)
committerAnn Kamyshnikova <akamyshnikova@mirantis.com>
Thu, 24 Apr 2014 06:58:26 +0000 (10:58 +0400)
Corrected the following models according to database
content:
- NOT NULL for LsnPort lsn_id;
- NOT NULL for NeutronNsxPortMapping nsx_port_id;

Partial-Bug: #1296282

Change-Id: Ia67fcc68eeceb27d9274adb652ab45b32152f01c

neutron/plugins/vmware/dbexts/lsn_db.py
neutron/plugins/vmware/dbexts/models.py

index 30a3bda8052427d85d4eeff13a987205041cc441..25a457ac7d2fb37a32c0724b3063901fc6eaa05d 100644 (file)
@@ -35,7 +35,8 @@ class LsnPort(models_v2.model_base.BASEV2):
 
     lsn_port_id = Column(String(36), primary_key=True)
 
-    lsn_id = Column(String(36), ForeignKey('lsn.lsn_id', ondelete="CASCADE"))
+    lsn_id = Column(String(36), ForeignKey('lsn.lsn_id', ondelete="CASCADE"),
+                    nullable=False)
     sub_id = Column(String(36), nullable=False, unique=True)
     mac_addr = Column(String(32), nullable=False, unique=True)
 
index 69c146be91c3ed23f277df469086016df0ec089a..35633281188ceac76a46b865791024a52dcfc4a8 100644 (file)
@@ -91,7 +91,7 @@ class NeutronNsxPortMapping(model_base.BASEV2):
                         ForeignKey('ports.id', ondelete="CASCADE"),
                         primary_key=True)
     nsx_switch_id = Column(String(36))
-    nsx_port_id = Column(String(36))
+    nsx_port_id = Column(String(36), nullable=False)
 
     def __init__(self, neutron_id, nsx_switch_id, nsx_port_id):
         self.neutron_id = neutron_id