Zane Bitter [Tue, 7 May 2013 13:10:10 +0000 (15:10 +0200)]
Add a wrappertask decorator
It is common that we might want to create a task that is a light wrapper
around another task. This allows us to, for example, call some clean-up
function after a PollingTaskGroup has completed. We really want to make
sure that any exceptions caused by timeout or cancellation get passed on to
the subtask as well.
Python 3 sports the "yield from" keyword (PEP 380) that effectively allows
the sort of nesting of generators that we want to do here. This change
provides a decorator function that allows the decorated generator function
to do the same thing using the "yield" keyword, even in Python 2.
Steven Hardy [Fri, 3 May 2013 10:43:54 +0000 (11:43 +0100)]
heat tests : convert most tests to inline templates
Convert to inline minimal templates, to remove dependency on
in-tree templates which we plan to remove. Note there are still
some more tests remaining which need similar changes (shardy todo)
Zane Bitter [Fri, 3 May 2013 13:57:57 +0000 (15:57 +0200)]
Fix error reporting in @stack_delete_after unit tests
If a unit test decorated with @stack_delete_after (to ensure that a stack
being tested is cleaned up) fails in such a way that the stack cannot be
cleaned up, the original error was suppressed, making debugging very
difficult. In this case, we should re-raise the original exception.
Zane Bitter [Fri, 3 May 2013 14:07:14 +0000 (16:07 +0200)]
Set Stack id to None when deleted
If a Stack object has been removed from the database, we should reset its
ID to None so that if the object is used further, it will not be assumed
that it is represented in the database.
Thomas Herve [Thu, 2 May 2013 13:13:52 +0000 (15:13 +0200)]
Support Snapshot policy in volumes
This handles the Snapshot DeletionPolicy in the AWS::EC2::Volume
resource, creating a backup of the volume before deleting it. It
requires a recent cinder client with backup support.
Steve Baker [Fri, 19 Apr 2013 15:55:43 +0000 (11:55 -0400)]
Sometimes use quantum for SecurityGroup
This implements the following properties in AWS::EC2::SecurityGroup
- VpcId
- SecurityGroupEgress
If VpcId is specified, completely separate code paths
are used which make quantum calls instead of nova calls.
This implements blueprint quantum-security-group
This is based off https://review.openstack.org/#/c/22280/
with a few enhancements:
- Quantum firewall rules translated to acceptable format for ICMP
- remote_ip_prefix used for security group rule creation
Change-Id: I8f1953cb559da0e97821ae0072dfb01dc8267c0c Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
Steven Hardy [Mon, 8 Apr 2013 13:53:04 +0000 (14:53 +0100)]
heat api : Update ec2token middleware for v4 signatures
Update ec2token so it can verify v4 signature formats.
Note for v4 signatures to work you currently need to install
the latest python-keystoneclient, as no release yet contains
patch ref https://review.openstack.org/#/c/26013/
This change should be backwards compatible, as older keystoneclient
versions will simply ignore the additional request keys
Clint Byrum [Wed, 1 May 2013 07:59:03 +0000 (00:59 -0700)]
Fix "No handlers could be found" warnings
These warnings are caused because nothing is capturing log output in
their test cases. HeatTestCase automatically does this using the
FakeLogger fixture.
Re-work run_tests.sh to call testr instead of nose
Running testr directly or running the tests in tox are the preferred
method at this point, but developers may still have automation around
run_tests.sh.
Remove use of nose attrib plugin and most unittest
Some simple cases that do not use mox still use unittest directly.
Replacing unittest.TestCase with HeatTestCase has the added benefit of
capturing all logging for reporting during failure.
A new base class for tests is used to reduce repetitive steps used in
a majority of tests. This new base class also uses fixtures.FakeLogger
to suppress logging, though it will be shown on any failures to aid in
debugging the failure.
Prints that happen on normal operation of the test suite are all removed
as they are not needed and only clutter the output.
These tests are not unit tests, and take a long time. They are being
moved into tempest, which is where integration/functional tests live in
OpenStack.
With the migration to testrepository, many of the instructions are
obsolete. Also the examples are not needed as we have plenty of fine
examples available in the code itself.
This also disables the functional tests from running. The code is still
left here for posterity. These are intended to be moved into tempest
test cases and thus will be removed entirely at that time.
At the moment, we will just run each co-routine to completion, but in
future we can use this to return control to the caller so that resources
may be created in parallel.
Steven Hardy [Tue, 30 Apr 2013 09:38:04 +0000 (10:38 +0100)]
heat api: fix ec2token authentication
Since the change merged from https://review.openstack.org/#/c/27383/
ec2token auth no longer works, because there is a mismatch between
the config file section name and the section specified in ec2token
This is currently broken since heat-engine always listens to the
'engine' topic and there isn't actually a good use case for this to be
configurable, so let's kill it.
We currently send engine RPCs to the 'engine.$host' topic means that
it is impossible to run heat-api and heat-engine on different
machines because you can't configure heat-api with the hostname of
heat-engine.
Fix this simply by sending RPCs to 'engine' which heat-engine. We have
always listened on this topic, so there is no backwards compat
concerns.
This is somewhat related to the multiple-engines blueprint, but
doesn't really help or hinder it.
The structure of the program is compromised by doing too much logic in
the import phase. We can read the code more cleanly if we can see where
the intended initialization code is called. This may make tests slightly
more tedious to write, but that should be handled by writing generic
fixtures which can be reused for exactly this purpose.
Previously resources would be left in the CREATE_IN_PROGRESS state in the
event of a timeout or the thread being cancelled (due to a delete being
requested while the stack was still being created). We should instead put
these resources into the CREATE_FAILED state when this occurs, thus
creating an event with the reason.
We don't want to store any state in the Instance object, instead take
advantage of the new mechanism whereby the result of handle_create() is
passed to check_active().
This makes the autoscaling code uglier for now (since it must still store
the instance state in the instance), but this will go away when we move to
using co-routines to create resources in parallel.
Steve Baker [Mon, 8 Apr 2013 03:47:46 +0000 (15:47 +1200)]
Remove service _user, _password, _tenant from context
These are not currently used anywhere in heat-engine, and I'm
not comfortable with the service password going over the (controller)
network.
If heat-engine needs access to these in the future then they can always
be configured in heat-engine.conf, or the operation can be performed
in the api and the results put into the context.
Steve Baker [Tue, 2 Apr 2013 23:29:50 +0000 (12:29 +1300)]
Move heat-api auth_token conf from paste.ini
keystone auth_token middleware now allows heat to have auth_token
configuration in heat-api.conf. Moves the example of
auth_token configuration from heat-api-paste.ini to heat-api.conf.
This simplifies user configuations and users is no longer required
to edit heat-api-paste.ini.
This does not break backward compatibility. auth_token first
tries the configurations in /etc/heat/heat-api-paste.ini and then the
above configurations. Thus a user who already uses heat-api-paste.ini
does not need to change it.