]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Add vlan_transparent attribute to network model
authorPritesh Kothari <pritesh.kothari@cisco.com>
Thu, 5 Feb 2015 23:20:38 +0000 (15:20 -0800)
committerPritesh Kothari <pritesh.kothari@cisco.com>
Fri, 6 Feb 2015 21:38:10 +0000 (13:38 -0800)
VLAN trunking networks for NFV blueprint needs a new vlan_transparent
attribute. Add this attribute to the network model.

Partially-Implements: blueprint nfv-vlan-trunks
Change-Id: Ib973f196989b3b119e309ce7100a1e7e7c73b3a4

neutron/db/migration/alembic_migrations/versions/HEAD
neutron/db/migration/alembic_migrations/versions/bebba223288_add_vlan_transparent_property_to_network.py [new file with mode: 0644]
neutron/db/models_v2.py
neutron/tests/unit/test_db_plugin.py

index 0e974fd024f84374c5e96841ecd785c11d9fdda8..0c8b6ed2229b1554e687873e0d55a4173b7dab96 100644 (file)
@@ -1 +1 @@
-43763a9618fd
\ No newline at end of file
+bebba223288
diff --git a/neutron/db/migration/alembic_migrations/versions/bebba223288_add_vlan_transparent_property_to_network.py b/neutron/db/migration/alembic_migrations/versions/bebba223288_add_vlan_transparent_property_to_network.py
new file mode 100644 (file)
index 0000000..b4173aa
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright 2015 OpenStack Foundation
+#
+#    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.
+#
+
+"""Add vlan transparent property to network
+
+Revision ID: bebba223288
+Revises: 43763a9618fd
+Create Date: 2015-02-04 18:07:29.670554
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = 'bebba223288'
+down_revision = '43763a9618fd'
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+    op.add_column('networks', sa.Column('vlan_transparent', sa.Boolean(),
+                  nullable=True))
+
+
+def downgrade():
+    op.drop_column('networks', 'vlan_transparent')
index 9f570d5c3304b3f74648149b3561e9a1cc4324f4..12da571184be3405a34d3ffc7e5ad28b3312afd2 100644 (file)
@@ -220,3 +220,4 @@ class Network(model_base.BASEV2, HasId, HasTenant):
     admin_state_up = sa.Column(sa.Boolean)
     shared = sa.Column(sa.Boolean)
     mtu = sa.Column(sa.Integer, nullable=True)
+    vlan_transparent = sa.Column(sa.Boolean, nullable=True)
index 9143f19209e896fcca29de9848d0d121c5f80cd4..a6bc8bdf5116af4fa598a72dc351be219033825b 100644 (file)
@@ -4182,7 +4182,7 @@ class DbModelTestCase(base.BaseTestCase):
         exp_end_with = (" {tenant_id=None, id=None, "
                         "name='net_net', status='OK', "
                         "admin_state_up=True, shared=None, "
-                        "mtu=None}>")
+                        "mtu=None, vlan_transparent=None}>")
         final_exp = exp_start_with + exp_middle + exp_end_with
         self.assertEqual(actual_repr_output, final_exp)