From: Pritesh Kothari Date: Thu, 5 Feb 2015 23:20:38 +0000 (-0800) Subject: Add vlan_transparent attribute to network model X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4a98eaf180a830762d930643478df22380f9e72d;p=openstack-build%2Fneutron-build.git Add vlan_transparent attribute to network model 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 --- diff --git a/neutron/db/migration/alembic_migrations/versions/HEAD b/neutron/db/migration/alembic_migrations/versions/HEAD index 0e974fd02..0c8b6ed22 100644 --- a/neutron/db/migration/alembic_migrations/versions/HEAD +++ b/neutron/db/migration/alembic_migrations/versions/HEAD @@ -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 index 000000000..b4173aa5c --- /dev/null +++ b/neutron/db/migration/alembic_migrations/versions/bebba223288_add_vlan_transparent_property_to_network.py @@ -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') diff --git a/neutron/db/models_v2.py b/neutron/db/models_v2.py index 9f570d5c3..12da57118 100644 --- a/neutron/db/models_v2.py +++ b/neutron/db/models_v2.py @@ -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) diff --git a/neutron/tests/unit/test_db_plugin.py b/neutron/tests/unit/test_db_plugin.py index 9143f1920..a6bc8bdf5 100644 --- a/neutron/tests/unit/test_db_plugin.py +++ b/neutron/tests/unit/test_db_plugin.py @@ -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)