]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Moved out cisco n1kv mech driver and db models
authorSaksham Varma <sakvarma@cisco.com>
Fri, 24 Jul 2015 05:46:23 +0000 (22:46 -0700)
committerHenry Gessau <gessau@cisco.com>
Thu, 30 Jul 2015 00:12:26 +0000 (00:12 +0000)
Moving out Cisco N1Kv database models and the mech driver
to the openstack/networking-cisco repo as part of the second
phase vendor-core decomposition

Partial-Bug: #1479123
Partial-implements: blueprint core-vendor-decomposition

Change-Id: I65a704b238d8cbe2951a6912fa4f1e8518c6f412

neutron/db/migration/alembic_migrations/external.py
neutron/db/migration/models/head.py
neutron/plugins/ml2/drivers/cisco/n1kv/__init__.py [deleted file]
neutron/plugins/ml2/drivers/cisco/n1kv/mech_cisco_n1kv.py [deleted file]
neutron/plugins/ml2/drivers/cisco/n1kv/n1kv_models.py [deleted file]
setup.cfg

index 0ac017f6763e6d16c8b2dca5419b4622c6db0194..46d24a45861c7e198648d0c3e1e199995bf4795b 100644 (file)
@@ -29,6 +29,13 @@ DRIVER_TABLES = [
     'cisco_ml2_apic_contracts',
     'cisco_ml2_apic_names',
     'cisco_ml2_apic_host_links',
+    'cisco_ml2_n1kv_policy_profiles',
+    'cisco_ml2_n1kv_network_profiles',
+    'cisco_ml2_n1kv_port_bindings',
+    'cisco_ml2_n1kv_network_bindings',
+    'cisco_ml2_n1kv_vxlan_allocations',
+    'cisco_ml2_n1kv_vlan_allocations',
+    'cisco_ml2_n1kv_profile_bindings',
     # Add your tables with moved models here^. Please end with a comma.
 ]
 
index 14be019615e605c120f7e75b55b97fba9aa3ddc2..6044cd4ab5ca0a07fb3a2afc3199dcc400738cec 100644 (file)
@@ -55,7 +55,6 @@ from neutron.plugins.cisco.db import network_models_v2  # noqa
 from neutron.plugins.ml2.drivers.arista import db  # noqa
 from neutron.plugins.ml2.drivers.brocade.db import (  # noqa
     models as ml2_brocade_models)
-from neutron.plugins.ml2.drivers.cisco.n1kv import n1kv_models  # noqa
 from neutron.plugins.ml2.drivers.cisco.nexus import (  # noqa
     nexus_models_v2 as ml2_nexus_models_v2)
 from neutron.plugins.ml2.drivers.cisco.ucsm import ucsm_model  # noqa
diff --git a/neutron/plugins/ml2/drivers/cisco/n1kv/__init__.py b/neutron/plugins/ml2/drivers/cisco/n1kv/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/neutron/plugins/ml2/drivers/cisco/n1kv/mech_cisco_n1kv.py b/neutron/plugins/ml2/drivers/cisco/n1kv/mech_cisco_n1kv.py
deleted file mode 100644 (file)
index 04e83a7..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2015 Cisco Systems, Inc.
-# All rights reserved.
-#
-#    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.
-
-"""
-ML2 Mechanism Driver for Cisco Nexus1000V distributed virtual switches.
-"""
-
-from networking_cisco.plugins.ml2.drivers.cisco.n1kv import mech_cisco_n1kv
-
-
-class N1KVMechanismDriver(mech_cisco_n1kv.N1KVMechanismDriver):
-    pass
diff --git a/neutron/plugins/ml2/drivers/cisco/n1kv/n1kv_models.py b/neutron/plugins/ml2/drivers/cisco/n1kv/n1kv_models.py
deleted file mode 100644 (file)
index bfbbb51..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-# Copyright 2015 Cisco Systems, Inc.
-# All rights reserved.
-#
-#    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.
-
-import sqlalchemy as sa
-from sqlalchemy import orm
-
-from neutron.db import model_base
-from neutron.db import models_v2
-from neutron.plugins.common import constants
-
-
-class PolicyProfile(model_base.BASEV2):
-
-    """
-    Nexus1000V Policy Profiles
-
-    Both 'profile_id' and 'name' are populated from Nexus1000V switch.
-    """
-    __tablename__ = 'cisco_ml2_n1kv_policy_profiles'
-
-    id = sa.Column(sa.String(36), nullable=False, primary_key=True)
-    name = sa.Column(sa.String(255), nullable=False)
-    vsm_ip = sa.Column(sa.String(16), nullable=False, primary_key=True)
-
-
-class NetworkProfile(model_base.BASEV2, models_v2.HasId):
-
-    """Nexus1000V Network Profiles created on the VSM."""
-    __tablename__ = 'cisco_ml2_n1kv_network_profiles'
-
-    name = sa.Column(sa.String(255), nullable=False)
-    segment_type = sa.Column(sa.Enum(constants.TYPE_VLAN,
-                                     constants.TYPE_VXLAN,
-                                     name='segment_type'),
-                             nullable=False)
-    sub_type = sa.Column(sa.String(255))
-    segment_range = sa.Column(sa.String(255))
-    multicast_ip_index = sa.Column(sa.Integer, default=0)
-    multicast_ip_range = sa.Column(sa.String(255))
-    physical_network = sa.Column(sa.String(255))
-
-
-class N1kvPortBinding(model_base.BASEV2):
-
-    """Represents binding of ports to policy profile."""
-    __tablename__ = 'cisco_ml2_n1kv_port_bindings'
-
-    port_id = sa.Column(sa.String(36),
-                        sa.ForeignKey('ports.id', ondelete="CASCADE"),
-                        primary_key=True)
-    profile_id = sa.Column(sa.String(36),
-                           nullable=False)
-    # Add a relationship to the Port model in order to instruct SQLAlchemy to
-    # eagerly load port bindings
-    port = orm.relationship(
-        models_v2.Port,
-        backref=orm.backref("n1kv_port_binding",
-                            lazy='joined', uselist=False,
-                            cascade='delete'))
-
-
-class N1kvNetworkBinding(model_base.BASEV2):
-
-    """Represents binding of virtual network to network profiles."""
-    __tablename__ = 'cisco_ml2_n1kv_network_bindings'
-
-    network_id = sa.Column(sa.String(36),
-                           sa.ForeignKey('networks.id', ondelete="CASCADE"),
-                           primary_key=True)
-    network_type = sa.Column(sa.String(32), nullable=False)
-    segmentation_id = sa.Column(sa.Integer)
-    profile_id = sa.Column(sa.String(36),
-                           sa.ForeignKey('cisco_ml2_n1kv_network_profiles.id'),
-                           nullable=False)
-
-
-class N1kvVlanAllocation(model_base.BASEV2):
-
-    """Represents allocation state of vlan_id on physical network."""
-    __tablename__ = 'cisco_ml2_n1kv_vlan_allocations'
-
-    physical_network = sa.Column(sa.String(64),
-                                 nullable=False,
-                                 primary_key=True)
-    vlan_id = sa.Column(sa.Integer, nullable=False, primary_key=True,
-                        autoincrement=False)
-    allocated = sa.Column(sa.Boolean, nullable=False, default=False)
-    network_profile_id = sa.Column(sa.String(36),
-                                   sa.ForeignKey(
-                                      'cisco_ml2_n1kv_network_profiles.id',
-                                      ondelete="CASCADE"),
-                                   nullable=False)
-
-
-class N1kvVxlanAllocation(model_base.BASEV2):
-
-    """Represents allocation state of vxlan_id."""
-    __tablename__ = 'cisco_ml2_n1kv_vxlan_allocations'
-
-    vxlan_id = sa.Column(sa.Integer, nullable=False, primary_key=True,
-                         autoincrement=False)
-    allocated = sa.Column(sa.Boolean, nullable=False, default=False)
-    network_profile_id = sa.Column(sa.String(36),
-                                   sa.ForeignKey(
-                                       'cisco_ml2_n1kv_network_profiles.id',
-                                       ondelete="CASCADE"),
-                                   nullable=False)
-
-
-class ProfileBinding(model_base.BASEV2):
-
-    """
-    Represents a binding of Network Profile
-    or Policy Profile to tenant_id
-    """
-    __tablename__ = 'cisco_ml2_n1kv_profile_bindings'
-
-    profile_type = sa.Column(sa.Enum('network', 'policy',
-                                     name='profile_type'),
-                             nullable=True)
-    tenant_id = sa.Column(sa.String(36),
-                          primary_key=True,
-                          nullable=False,
-                          default='tenant_id_not_set',
-                          server_default='tenant_id_not_set')
-    profile_id = sa.Column(sa.String(36), primary_key=True, nullable=False)
index c0eee51951395a77418d009bd6b1d33195e4b4ad..6eb5adf5a13fd113952d4bbc11fafb9b7ff11899 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -173,7 +173,6 @@ neutron.ml2.mechanism_drivers =
     ncs = neutron.plugins.ml2.drivers.cisco.ncs.driver:NCSMechanismDriver
     cisco_ncs = neutron.plugins.ml2.drivers.cisco.ncs.driver:NCSMechanismDriver
     cisco_nexus = neutron.plugins.ml2.drivers.cisco.nexus.mech_cisco_nexus:CiscoNexusMechanismDriver
-    cisco_n1kv = neutron.plugins.ml2.drivers.cisco.n1kv.mech_cisco_n1kv:N1KVMechanismDriver
     cisco_ucsm = neutron.plugins.ml2.drivers.cisco.ucsm.mech_cisco_ucsm:CiscoUcsmMechanismDriver
     l2population = neutron.plugins.ml2.drivers.l2pop.mech_driver:L2populationMechanismDriver
     bigswitch = neutron.plugins.ml2.drivers.mech_bigswitch.driver:BigSwitchMechanismDriver