Merge "Move extraroute resource in-tree"

changes/52/181152/5
Jenkins 8 years ago committed by Gerrit Code Review
commit b764ee801b
  1. 40
      contrib/extraroute/README.md
  2. 0
      contrib/extraroute/extraroute/__init__.py
  3. 0
      contrib/extraroute/extraroute/resources/__init__.py
  4. 0
      contrib/extraroute/extraroute/tests/__init__.py
  5. 27
      contrib/extraroute/setup.cfg
  6. 30
      contrib/extraroute/setup.py
  7. 5
      heat/engine/resources/openstack/neutron/extraroute.py
  8. 7
      heat/tests/neutron/test_extraroute.py

@ -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"
}
}

@ -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

@ -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)

@ -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,
) = (

@ -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
Loading…
Cancel
Save