Move barbican resources in-tree

This change relocates the barbican resources from the contrib area into
the main resource tree.

Change-Id: Iac49e9e2bda4af76308ec12aaa66978a0ffd5fca
This commit is contained in:
Miguel Grinberg 2015-06-02 15:00:04 -07:00
parent 0459eec086
commit d7622c5b51
10 changed files with 7 additions and 94 deletions

View File

@ -1,18 +0,0 @@
Barbican plugin for OpenStack Heat
================================
This plugin enables using Barbican resources in a Heat template.
### 1. Install the Barbican 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.

View File

@ -1,30 +0,0 @@
[metadata]
name = heat-contrib-barbican
summary = Heat resources for Barbican
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]
packages =
heat_barbican
# Copy to /usr/lib/heat for plugin loading
data_files =
lib/heat/barbican = heat_barbican/resources/*
[global]
setup-hooks =
pbr.hooks.setup_hook

View File

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

View File

@ -25,6 +25,8 @@ from heat.engine import support
class Order(resource.Resource):
support_status = support.SupportStatus(version='2014.2')
PROPERTIES = (
NAME, PAYLOAD_CONTENT_TYPE, MODE, EXPIRATION,
ALGORITHM, BIT_LENGTH, TYPE, REQUEST_TYPE, SUBJECT_DN,

View File

@ -19,10 +19,13 @@ from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine import support
class Secret(resource.Resource):
support_status = support.SupportStatus(version='2014.2')
PROPERTIES = (
NAME, PAYLOAD, PAYLOAD_CONTENT_TYPE, PAYLOAD_CONTENT_ENCODING,
MODE, EXPIRATION, ALGORITHM, BIT_LENGTH,

View File

@ -16,14 +16,12 @@ import six
from heat.common import exception
from heat.common import template_format
from heat.engine import resource
from heat.engine.resources.openstack.barbican import order
from heat.engine import rsrc_defn
from heat.engine import scheduler
from heat.tests import common
from heat.tests import utils
from ..resources import order # noqa
stack_template = '''
heat_template_version: 2013-05-23
description: Test template
@ -59,7 +57,6 @@ class TestOrder(common.HeatTestCase):
resource_defns = self.stack.t.resource_definitions(self.stack)
self.res_template = resource_defns['order']
self.props = tmpl['resources']['order']['properties']
self._register_resources()
self.patcher_client = mock.patch.object(order.Order, 'barbican')
mock_client = self.patcher_client.start()
@ -69,10 +66,6 @@ class TestOrder(common.HeatTestCase):
super(TestOrder, self).tearDown()
self.patcher_client.stop()
def _register_resources(self):
for res_name, res_class in six.iteritems(order.resource_mapping()):
resource._register_class(res_name, res_class)
def _create_resource(self, name, snippet, stack):
res = order.Order(name, snippet, stack)
res.check_create_complete = mock.Mock(return_value=True)

View File

@ -16,14 +16,12 @@ import six
from heat.common import exception
from heat.common import template_format
from heat.engine import resource
from heat.engine.resources.openstack.barbican import secret
from heat.engine import rsrc_defn
from heat.engine import scheduler
from heat.tests import common
from heat.tests import utils
from ..resources import secret # noqa
stack_template = '''
heat_template_version: 2013-05-23
description: Test template
@ -55,7 +53,6 @@ class TestSecret(common.HeatTestCase):
mock_client = self.patcher_client.start()
self.barbican = mock_client.return_value
self._register_resources()
self.stack = utils.parse_stack(template_format.parse(stack_template))
self.stack.validate()
resource_defns = self.stack.t.resource_definitions(self.stack)
@ -66,10 +63,6 @@ class TestSecret(common.HeatTestCase):
super(TestSecret, self).tearDown()
self.patcher_client.stop()
def _register_resources(self):
for res_name, res_class in six.iteritems(secret.resource_mapping()):
resource._register_class(res_name, res_class)
def _create_resource(self, name, snippet, stack):
res = secret.Secret(name, snippet, stack)
self.barbican.secrets.create.return_value = FakeSecret(name + '_id')