From b61cd4eaedc3a65657d5dbf8b09ec3c39f250637 Mon Sep 17 00:00:00 2001 From: Shweta P Date: Thu, 27 Aug 2015 16:53:13 -0400 Subject: [PATCH] Final decomposition of Cisco plugin This patch follows the previous patch(listed as dependent) and moves the remaining cisco db models from neutron to networking-cisco. The patch deletes l3_model and cisco_router_plugin and their associated config and helper files from neutron Change-Id: I5b71e1dfb683e633e1cd11386dfb7c2ed7cc7d62 Partial-Bug: #1489609 --- etc/neutron/plugins/cisco/cisco_cfg_agent.ini | 15 --- .../plugins/cisco/cisco_router_plugin.ini | 76 --------------- .../alembic_migrations/cisco_init_ops.py | 4 +- .../migration/alembic_migrations/external.py | 3 + neutron/db/migration/models/head.py | 1 - neutron/plugins/cisco/__init__.py | 0 neutron/plugins/cisco/common/__init__.py | 0 .../plugins/cisco/common/cisco_constants.py | 25 ----- neutron/plugins/cisco/db/__init__.py | 0 neutron/plugins/cisco/db/l3/__init__.py | 0 neutron/plugins/cisco/db/l3/l3_models.py | 97 ------------------- .../plugins/cisco/service_plugins/__init__.py | 0 .../service_plugins/cisco_router_plugin.py | 24 ----- .../cisco/service_plugins/requirements.txt | 1 - setup.cfg | 2 - tools/check_unit_test_structure.sh | 1 - 16 files changed, 4 insertions(+), 245 deletions(-) delete mode 100644 etc/neutron/plugins/cisco/cisco_cfg_agent.ini delete mode 100644 etc/neutron/plugins/cisco/cisco_router_plugin.ini delete mode 100644 neutron/plugins/cisco/__init__.py delete mode 100644 neutron/plugins/cisco/common/__init__.py delete mode 100644 neutron/plugins/cisco/common/cisco_constants.py delete mode 100644 neutron/plugins/cisco/db/__init__.py delete mode 100644 neutron/plugins/cisco/db/l3/__init__.py delete mode 100644 neutron/plugins/cisco/db/l3/l3_models.py delete mode 100644 neutron/plugins/cisco/service_plugins/__init__.py delete mode 100644 neutron/plugins/cisco/service_plugins/cisco_router_plugin.py delete mode 100644 neutron/plugins/cisco/service_plugins/requirements.txt diff --git a/etc/neutron/plugins/cisco/cisco_cfg_agent.ini b/etc/neutron/plugins/cisco/cisco_cfg_agent.ini deleted file mode 100644 index d99e8382785..00000000000 --- a/etc/neutron/plugins/cisco/cisco_cfg_agent.ini +++ /dev/null @@ -1,15 +0,0 @@ -[cfg_agent] -# (IntOpt) Interval in seconds for processing of service updates. -# That is when the config agent's process_services() loop executes -# and it lets each service helper to process its service resources. -# rpc_loop_interval = 10 - -# (StrOpt) Period-separated module path to the routing service helper class. -# routing_svc_helper_class = neutron.plugins.cisco.cfg_agent.service_helpers.routing_svc_helper.RoutingServiceHelper - -# (IntOpt) Timeout value in seconds for connecting to a hosting device. -# device_connection_timeout = 30 - -# (IntOpt) The time in seconds until a backlogged hosting device is -# presumed dead or booted to an error state. -# hosting_device_dead_timeout = 300 diff --git a/etc/neutron/plugins/cisco/cisco_router_plugin.ini b/etc/neutron/plugins/cisco/cisco_router_plugin.ini deleted file mode 100644 index 3ef271d243b..00000000000 --- a/etc/neutron/plugins/cisco/cisco_router_plugin.ini +++ /dev/null @@ -1,76 +0,0 @@ -[general] -#(IntOpt) Time in seconds between renewed scheduling attempts of non-scheduled routers -# backlog_processing_interval = 10 - -#(StrOpt) Name of the L3 admin tenant -# l3_admin_tenant = L3AdminTenant - -#(StrOpt) Name of management network for hosting device configuration -# management_network = osn_mgmt_nw - -#(StrOpt) Default security group applied on management port -# default_security_group = mgmt_sec_grp - -#(IntOpt) Seconds of no status update until a cfg agent is considered down -# cfg_agent_down_time = 60 - -#(StrOpt) Path to templates for hosting devices -# templates_path = /opt/stack/data/neutron/cisco/templates - -#(StrOpt) Path to config drive files for service VM instances -# service_vm_config_path = /opt/stack/data/neutron/cisco/config_drive - -#(BoolOpt) Ensure that Nova is running before attempting to create any VM -# ensure_nova_running = True - -[hosting_devices] -# Settings coupled to CSR1kv VM devices -# ------------------------------------- -#(StrOpt) Name of Glance image for CSR1kv -# csr1kv_image = csr1kv_openstack_img - -#(StrOpt) UUID of Nova flavor for CSR1kv -# csr1kv_flavor = 621 - -#(StrOpt) Plugging driver for CSR1kv -# csr1kv_plugging_driver = neutron.plugins.cisco.l3.plugging_drivers.n1kv_trunking_driver.N1kvTrunkingPlugDriver - -#(StrOpt) Hosting device driver for CSR1kv -# csr1kv_device_driver = neutron.plugins.cisco.l3.hosting_device_drivers.csr1kv_hd_driver.CSR1kvHostingDeviceDriver - -#(StrOpt) Config agent router service driver for CSR1kv -# csr1kv_cfgagent_router_driver = neutron.plugins.cisco.cfg_agent.device_drivers.csr1kv.csr1kv_routing_driver.CSR1kvRoutingDriver - -#(StrOpt) Configdrive template file for CSR1kv -# csr1kv_configdrive_template = csr1kv_cfg_template - -#(IntOpt) Booting time in seconds before a CSR1kv becomes operational -# csr1kv_booting_time = 420 - -#(StrOpt) Username to use for CSR1kv configurations -# csr1kv_username = stack - -#(StrOpt) Password to use for CSR1kv configurations -# csr1kv_password = cisco - -[n1kv] -# Settings coupled to inter-working with N1kv plugin -# -------------------------------------------------- -#(StrOpt) Name of N1kv port profile for management ports -# management_port_profile = osn_mgmt_pp - -#(StrOpt) Name of N1kv port profile for T1 ports (i.e., ports carrying traffic -# from VXLAN segmented networks). -# t1_port_profile = osn_t1_pp - -#(StrOpt) Name of N1kv port profile for T2 ports (i.e., ports carrying traffic -# from VLAN segmented networks). -# t2_port_profile = osn_t2_pp - -#(StrOpt) Name of N1kv network profile for T1 networks (i.e., trunk networks -# for VXLAN segmented traffic). -# t1_network_profile = osn_t1_np - -#(StrOpt) Name of N1kv network profile for T2 networks (i.e., trunk networks -# for VLAN segmented traffic). -# t2_network_profile = osn_t2_np diff --git a/neutron/db/migration/alembic_migrations/cisco_init_ops.py b/neutron/db/migration/alembic_migrations/cisco_init_ops.py index 3c99f7b933e..9df1bccc182 100644 --- a/neutron/db/migration/alembic_migrations/cisco_init_ops.py +++ b/neutron/db/migration/alembic_migrations/cisco_init_ops.py @@ -18,8 +18,6 @@ from alembic import op import sqlalchemy as sa -from neutron.plugins.cisco.common import cisco_constants - segment_type = sa.Enum('vlan', 'overlay', 'trunk', 'multi-segment', name='segment_type') profile_type = sa.Enum('network', 'policy', name='profile_type') @@ -93,7 +91,7 @@ def upgrade(): 'cisco_n1kv_profile_bindings', sa.Column('profile_type', profile_type, nullable=True), sa.Column('tenant_id', sa.String(length=36), nullable=False, - server_default=cisco_constants.TENANT_ID_NOT_SET), + server_default='TENANT_ID_NOT_SET'), sa.Column('profile_id', sa.String(length=36), nullable=False), sa.PrimaryKeyConstraint('tenant_id', 'profile_id')) diff --git a/neutron/db/migration/alembic_migrations/external.py b/neutron/db/migration/alembic_migrations/external.py index cd63c2f7226..49855b82f50 100644 --- a/neutron/db/migration/alembic_migrations/external.py +++ b/neutron/db/migration/alembic_migrations/external.py @@ -48,6 +48,9 @@ REPO_CISCO_TABLES = [ 'ml2_nexus_vxlan_allocations', 'ml2_nexus_vxlan_mcast_groups', 'ml2_ucsm_port_profiles', + 'cisco_hosting_devices', + 'cisco_port_mappings', + 'cisco_router_mappings', ] # VMware-NSX models moved to openstack/vmware-nsx diff --git a/neutron/db/migration/models/head.py b/neutron/db/migration/models/head.py index c4ca5e2f3ac..1a490e46aff 100644 --- a/neutron/db/migration/models/head.py +++ b/neutron/db/migration/models/head.py @@ -50,7 +50,6 @@ from neutron.ipam.drivers.neutrondb_ipam import db_models # noqa from neutron.plugins.bigswitch.db import consistency_db # noqa from neutron.plugins.bigswitch import routerrule_db # noqa from neutron.plugins.brocade.db import models as brocade_models # noqa -from neutron.plugins.cisco.db.l3 import l3_models # noqa from neutron.plugins.ml2.drivers.brocade.db import ( # noqa models as ml2_brocade_models) from neutron.plugins.ml2.drivers import type_flat # noqa diff --git a/neutron/plugins/cisco/__init__.py b/neutron/plugins/cisco/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/neutron/plugins/cisco/common/__init__.py b/neutron/plugins/cisco/common/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/neutron/plugins/cisco/common/cisco_constants.py b/neutron/plugins/cisco/common/cisco_constants.py deleted file mode 100644 index 43e6e468982..00000000000 --- a/neutron/plugins/cisco/common/cisco_constants.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2011 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. - - -TENANT_ID_NOT_SET = 'TENANT_ID_NOT_SET' - -# Type and topic for Cisco cfg agent -# ================================== -AGENT_TYPE_CFG = 'Cisco cfg agent' - -# Topic for Cisco configuration agent -CFG_AGENT = 'cisco_cfg_agent' -# Topic for routing service helper in Cisco configuration agent -CFG_AGENT_L3_ROUTING = 'cisco_cfg_agent_l3_routing' diff --git a/neutron/plugins/cisco/db/__init__.py b/neutron/plugins/cisco/db/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/neutron/plugins/cisco/db/l3/__init__.py b/neutron/plugins/cisco/db/l3/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/neutron/plugins/cisco/db/l3/l3_models.py b/neutron/plugins/cisco/db/l3/l3_models.py deleted file mode 100644 index 62a0dee5b02..00000000000 --- a/neutron/plugins/cisco/db/l3/l3_models.py +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright 2014 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 agents_db -from neutron.db import l3_db -from neutron.db import model_base -from neutron.db import models_v2 - - -class HostingDevice(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): - """Represents an appliance hosting Neutron router(s). - - When the hosting device is a Nova VM 'id' is uuid of that VM. - """ - __tablename__ = 'cisco_hosting_devices' - - # complementary id to enable identification of associated Neutron resources - complementary_id = sa.Column(sa.String(36)) - # manufacturer id of the device, e.g., its serial number - device_id = sa.Column(sa.String(255)) - admin_state_up = sa.Column(sa.Boolean, nullable=False, default=True) - # 'management_port_id' is the Neutron Port used for management interface - management_port_id = sa.Column(sa.String(36), - sa.ForeignKey('ports.id', - ondelete="SET NULL")) - management_port = orm.relationship(models_v2.Port) - # 'protocol_port' is udp/tcp port of hosting device. May be empty. - protocol_port = sa.Column(sa.Integer) - cfg_agent_id = sa.Column(sa.String(36), - sa.ForeignKey('agents.id'), - nullable=True) - cfg_agent = orm.relationship(agents_db.Agent) - # Service VMs take time to boot so we store creation time - # so we can give preference to older ones when scheduling - created_at = sa.Column(sa.DateTime, nullable=False) - status = sa.Column(sa.String(16)) - - -class HostedHostingPortBinding(model_base.BASEV2): - """Represents binding of logical resource's port to its hosting port.""" - __tablename__ = 'cisco_port_mappings' - - logical_resource_id = sa.Column(sa.String(36), primary_key=True) - logical_port_id = sa.Column(sa.String(36), - sa.ForeignKey('ports.id', - ondelete="CASCADE"), - primary_key=True) - logical_port = orm.relationship( - models_v2.Port, - primaryjoin='Port.id==HostedHostingPortBinding.logical_port_id', - backref=orm.backref('hosting_info', cascade='all', uselist=False)) - # type of hosted port, e.g., router_interface, ..._gateway, ..._floatingip - port_type = sa.Column(sa.String(32)) - # type of network the router port belongs to - network_type = sa.Column(sa.String(32)) - hosting_port_id = sa.Column(sa.String(36), - sa.ForeignKey('ports.id', - ondelete='CASCADE')) - hosting_port = orm.relationship( - models_v2.Port, - primaryjoin='Port.id==HostedHostingPortBinding.hosting_port_id') - # VLAN tag for trunk ports - segmentation_id = sa.Column(sa.Integer, autoincrement=False) - - -class RouterHostingDeviceBinding(model_base.BASEV2): - """Represents binding between Neutron routers and their hosting devices.""" - __tablename__ = 'cisco_router_mappings' - - router_id = sa.Column(sa.String(36), - sa.ForeignKey('routers.id', ondelete='CASCADE'), - primary_key=True) - router = orm.relationship( - l3_db.Router, - backref=orm.backref('hosting_info', cascade='all', uselist=False)) - # If 'auto_schedule' is True then router is automatically scheduled - # if it lacks a hosting device or its hosting device fails. - auto_schedule = sa.Column(sa.Boolean, default=True, nullable=False) - # id of hosting device hosting this router, None/NULL if unscheduled. - hosting_device_id = sa.Column(sa.String(36), - sa.ForeignKey('cisco_hosting_devices.id', - ondelete='SET NULL')) - hosting_device = orm.relationship(HostingDevice) diff --git a/neutron/plugins/cisco/service_plugins/__init__.py b/neutron/plugins/cisco/service_plugins/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/neutron/plugins/cisco/service_plugins/cisco_router_plugin.py b/neutron/plugins/cisco/service_plugins/cisco_router_plugin.py deleted file mode 100644 index 783578a9d8a..00000000000 --- a/neutron/plugins/cisco/service_plugins/cisco_router_plugin.py +++ /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. - -from networking_cisco.plugins.cisco.service_plugins import cisco_router_plugin - - -class CiscoRouterPluginRpcCallbacks( - cisco_router_plugin.CiscoRouterPluginRpcCallbacks): - pass - - -class CiscoRouterPlugin(cisco_router_plugin.CiscoRouterPlugin): - pass diff --git a/neutron/plugins/cisco/service_plugins/requirements.txt b/neutron/plugins/cisco/service_plugins/requirements.txt deleted file mode 100644 index ef631a3f2b9..00000000000 --- a/neutron/plugins/cisco/service_plugins/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -networking-cisco diff --git a/setup.cfg b/setup.cfg index 6015ced5a9d..f1e2db29dd4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -51,8 +51,6 @@ data_files = etc/neutron/plugins/brocade/brocade_mlx.ini etc/neutron/plugins/brocade/vyatta = etc/neutron/plugins/brocade/vyatta/vrouter.ini etc/neutron/plugins/cisco = - etc/neutron/plugins/cisco/cisco_cfg_agent.ini - etc/neutron/plugins/cisco/cisco_router_plugin.ini etc/neutron/plugins/cisco/cisco_vpn_agent.ini etc/neutron/plugins/embrane = etc/neutron/plugins/embrane/heleos_conf.ini etc/neutron/plugins/midonet = etc/neutron/plugins/midonet/midonet.ini diff --git a/tools/check_unit_test_structure.sh b/tools/check_unit_test_structure.sh index 191c86a8aec..b5304c8d181 100755 --- a/tools/check_unit_test_structure.sh +++ b/tools/check_unit_test_structure.sh @@ -14,7 +14,6 @@ ignore_regexes=( # The following vendor plugins are not required to confrm to the # structural requirements. "^plugins/brocade.*$" - "^plugins/cisco.*$" "^plugins/embrane.*$" "^plugins/ibm.*$" "^plugins/oneconvergence.*$"