From 6080985be45704c1fc2439198938b7fb98091c4b Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Thu, 28 May 2015 17:33:10 -0700 Subject: [PATCH] Move extraroute resource in-tree This change relocates the extraroute resource from the contrib area into the main resource tree, marking it as unsupported. Change-Id: I6a51c9bdfb39d61adac48e5bcdf76f04a94e70a1 --- contrib/extraroute/README.md | 40 ------------------- contrib/extraroute/extraroute/__init__.py | 0 .../extraroute/resources/__init__.py | 0 .../extraroute/extraroute/tests/__init__.py | 0 contrib/extraroute/setup.cfg | 27 ------------- contrib/extraroute/setup.py | 30 -------------- .../openstack/neutron}/extraroute.py | 5 +++ .../tests/neutron}/test_extraroute.py | 7 +--- 8 files changed, 6 insertions(+), 103 deletions(-) delete mode 100644 contrib/extraroute/README.md delete mode 100644 contrib/extraroute/extraroute/__init__.py delete mode 100644 contrib/extraroute/extraroute/resources/__init__.py delete mode 100644 contrib/extraroute/extraroute/tests/__init__.py delete mode 100644 contrib/extraroute/setup.cfg delete mode 100644 contrib/extraroute/setup.py rename {contrib/extraroute/extraroute/resources => heat/engine/resources/openstack/neutron}/extraroute.py (95%) rename {contrib/extraroute/extraroute/tests => heat/tests/neutron}/test_extraroute.py (96%) diff --git a/contrib/extraroute/README.md b/contrib/extraroute/README.md deleted file mode 100644 index a6df3c858f..0000000000 --- a/contrib/extraroute/README.md +++ /dev/null @@ -1,40 +0,0 @@ -ExtraRoute plugin for OpenStack Heat -==================================== - -This plugin enables using ExtraRoute as a resource in a Heat template. - -This resource allows assigning extra routes to Neutron routers via Heat -templates. - -NOTE: Implementing ExtraRoute in the main heat tree is under discussion in the -heat community. - -This plugin has been implemented in contrib to provide access to the -functionality while the discussion takes place, as some users have an immediate -requirement for it. -It may be moved to the main heat tree in due-course, depending on the outcome -of the community discussion. - -### 1. Install the ExtraRoute plugin in Heat - -NOTE: These instructions assume the value of heat.conf plugin_dirs includes the -default directory /usr/lib/heat. - -To install the plugin, from this directory run: - sudo python ./setup.py install - -### 2. Restart heat - -Only the process "heat-engine" needs to be restarted to load the newly -installed plugin. - -### 3. Example of ExtraRoute - -"router_extraroute": { - "Type": "OS::Neutron::ExtraRoute", - "Properties": { - "router_id": { "Ref" : "router" }, - "destination": "172.16.0.0/24", - "nexthop": "192.168.0.254" - } -} diff --git a/contrib/extraroute/extraroute/__init__.py b/contrib/extraroute/extraroute/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/contrib/extraroute/extraroute/resources/__init__.py b/contrib/extraroute/extraroute/resources/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/contrib/extraroute/extraroute/tests/__init__.py b/contrib/extraroute/extraroute/tests/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/contrib/extraroute/setup.cfg b/contrib/extraroute/setup.cfg deleted file mode 100644 index 089827c6ea..0000000000 --- a/contrib/extraroute/setup.cfg +++ /dev/null @@ -1,27 +0,0 @@ -[metadata] -name = heat-contrib-extraroute -summary = Heat resource for ExtraRoute -description-file = - README.md -author = OpenStack -author-email = openstack-dev@lists.openstack.org -home-page = http://www.openstack.org/ -classifier = - Environment :: OpenStack - Intended Audience :: Information Technology - Intended Audience :: System Administrators - License :: OSI Approved :: Apache Software License - Operating System :: POSIX :: Linux - Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 - Programming Language :: Python :: 2.6 - -[files] -# Copy to /usr/lib/heat for plugin loading -data_files = - lib/heat/extraroute = extraroute/resources/* - -[global] -setup-hooks = - pbr.hooks.setup_hook diff --git a/contrib/extraroute/setup.py b/contrib/extraroute/setup.py deleted file mode 100644 index 736375744d..0000000000 --- a/contrib/extraroute/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. -# -# 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. - -# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT -import setuptools - -# In python < 2.7.4, a lazy loading of package `pbr` will break -# setuptools if some other modules registered functions in `atexit`. -# solution from: http://bugs.python.org/issue15881#msg170215 -try: - import multiprocessing # noqa -except ImportError: - pass - -setuptools.setup( - setup_requires=['pbr'], - pbr=True) diff --git a/contrib/extraroute/extraroute/resources/extraroute.py b/heat/engine/resources/openstack/neutron/extraroute.py similarity index 95% rename from contrib/extraroute/extraroute/resources/extraroute.py rename to heat/engine/resources/openstack/neutron/extraroute.py index ef2037e7c8..1cc1b526ad 100644 --- a/contrib/extraroute/extraroute/resources/extraroute.py +++ b/heat/engine/resources/openstack/neutron/extraroute.py @@ -19,10 +19,15 @@ from heat.common.i18n import _ from heat.engine import constraints from heat.engine import properties from heat.engine.resources.openstack.neutron import neutron +from heat.engine import support class ExtraRoute(neutron.NeutronResource): + support_status = support.SupportStatus( + status=support.UNSUPPORTED, + message=_('This resource is not supported, use at your own risk.')) + PROPERTIES = ( ROUTER_ID, DESTINATION, NEXTHOP, ) = ( diff --git a/contrib/extraroute/extraroute/tests/test_extraroute.py b/heat/tests/neutron/test_extraroute.py similarity index 96% rename from contrib/extraroute/extraroute/tests/test_extraroute.py rename to heat/tests/neutron/test_extraroute.py index 721edca136..e46ddb4157 100644 --- a/contrib/extraroute/extraroute/tests/test_extraroute.py +++ b/heat/tests/neutron/test_extraroute.py @@ -14,13 +14,11 @@ from neutronclient.v2_0 import client as neutronclient from heat.common import template_format -from heat.engine import resource +from heat.engine.resources.openstack.neutron import extraroute from heat.engine import scheduler from heat.tests import common from heat.tests import utils -from ..resources import extraroute # noqa - neutron_template = ''' { @@ -58,9 +56,6 @@ class NeutronExtraRouteTest(common.HeatTestCase): self.m.StubOutWithMock(neutronclient.Client, 'show_router') self.m.StubOutWithMock(neutronclient.Client, 'update_router') - resource._register_class("OS::Neutron::ExtraRoute", - extraroute.ExtraRoute) - def create_extraroute(self, t, stack, resource_name, properties=None): properties = properties or {} t['Resources'][resource_name]['Properties'] = properties