Steven Hardy [Fri, 17 May 2013 12:17:57 +0000 (13:17 +0100)]
engine : cleanup Resource.update error paths
The current update code uses a nasty pattern where returning an
arbitrary string from Resource.update is interpreted in parser.Stack
as an error. Instead use exceptions which is much nicer :)
Michael Still [Sat, 18 May 2013 23:17:47 +0000 (09:17 +1000)]
The utils module in oslo is no more.
The utils module in oslo has been removed (with most of its
functionality moving across to strutils). Luckily it was imported
in heat but never actually used, so removing it is relatively easy.
Monty Taylor [Thu, 16 May 2013 16:24:17 +0000 (09:24 -0700)]
Clean up a pyflakes error in a comment.
This is a little-bit silly, but it's the last thing. pyflakes parses
python lines that are in docstring comments that are prefaced by >>>.
So, without the import, pyflakes complains about undefined import.
Monty Taylor [Thu, 16 May 2013 16:20:51 +0000 (09:20 -0700)]
Align usage of test skipping.
There were three different mechanisms for skipping tests in the suite.
For the most part, skipIf was used, so sync to that. Additionally, it
was being used as a decorater in most places, but as a call in a few,
so make it a decorator everywhere. Finally, if it's on the setUp method,
it's not necessary for it to be on any of the individual tests in the class.
Steve Baker [Fri, 17 May 2013 01:47:28 +0000 (13:47 +1200)]
Initialise resources when service is created.
Without this, calls to validate_template will fail until the first
parser.Stack is created.
resources.initialise() is called in EngineService __init__
to avoid this happening in another service method in the future Fixes: bug #1181045
Change-Id: I68a74ec7993aff4b74d449a3ae33315b93e9cb0d
Zane Bitter [Wed, 15 May 2013 20:26:09 +0000 (22:26 +0200)]
Clean up import of cinderclient exceptions
Don't import a particular version of the cinderclient API - just import the
client module and pass the version we want to the Client() constructor as
is intended. This allows up to access the exceptions directly through
client.exceptions, rather than having to do a separate import.
Zane Bitter [Thu, 16 May 2013 11:18:19 +0000 (13:18 +0200)]
Handle errors in Volume creation
Set the resource_id as soon as it is know, since we need to be able to
delete the volume later, even if it is in an error state. Avoid attempting
to perform a snapshot if the volume was never created successfully.
Zane Bitter [Thu, 16 May 2013 11:18:18 +0000 (13:18 +0200)]
Rename handle_snapshot and pass state
Rename handle_snapshot() to handle_snapshot_delete() to better reflect what
it needs to do (both take a snapshot of the resource and then delete the
resource). Also, pass the state of the resource prior to delete being
invoked, since the resource may want to use different error handling in the
snapshot phase depending on e.g. whether the resource was created
successfully or not.
Zane Bitter [Wed, 15 May 2013 13:59:38 +0000 (15:59 +0200)]
Clean up VPC unit tests
- Ensure that stacks are cleaned up on failure.
- Add a test for the case where an something other than a valid reference
is passed as the GroupSet.
- Add a test for the case where no GroupSet is passed.
Steve Baker [Tue, 14 May 2013 23:43:44 +0000 (11:43 +1200)]
Use python logging for loguserdata.py, log to console
Python logging is configured with a stream handler and should
also replicate the previous logging to 0600 /var/log/heat-provision.log
By logging to a stream handler cloud-init will write to its log,
which will show up in the server console log. This means that heat
provisioning can now be monitored without needing to log in with:
nova console-log <servername>
This change also touches the file /var/lib/heat-cfntools/provision-finished
instead of also writing a datestamp to it, which is redundant.
Mark McLoughlin [Thu, 2 May 2013 09:28:20 +0000 (10:28 +0100)]
Copy the RHEL6 eventlet workaround from Oslo
Tests in oslo-incubator now need the horrendous hack to workaround an
issue with eventlet on RHEL6. We've moved the patch_tox_venv tool
and redhat-eventlet.patch into oslo-incubator, so add them to
openstack-common.conf.
Steven Hardy [Mon, 13 May 2013 13:45:56 +0000 (14:45 +0100)]
engine : rename check_active to make it more generic
Rename check_active to check_create_complete, since "active" is
really a detail of Instance state, and so it seems wrong for other
resources which take a long time to create but are not Instance
based (e.g WaitConditions). This change will also allow us to
align other stack "state check" functions with the state we're
checking for in a consistent way (e.g check_delete_complete etc)
Steven Hardy [Fri, 10 May 2013 16:09:34 +0000 (17:09 +0100)]
api : Fix template-show partial URL redirect
All other API actions will provide a redirect if you only provide the
stack ID or name (rather than both), the template URL currently doesn't
because the template subpath is missing from the mapper lookup
Winson Chan [Wed, 8 May 2013 06:13:49 +0000 (23:13 -0700)]
Implement the SubnetId property in the Instance resource
If the SubnetId parameter is given in the template, the handle_create method
in the Instance resource verifies the subnet in quantum and configures the
NetworkInterfaces for the subnet. If no NetworkInterface is specified, a port
is created for the subnet and the nic is configured to use that port.
Steven Hardy [Wed, 8 May 2013 13:43:12 +0000 (14:43 +0100)]
heat-cfn : Make error with missing auth details more obvious
Exit with an error message describing the missing auth details
instead of failing with cryptic "Name or service not known" error
when credentials etc are missing
Zane Bitter [Wed, 8 May 2013 11:41:48 +0000 (13:41 +0200)]
Skip more tests that require Cinder backups
Most of the unit tests that require the backups feature in
python-cinderclient have been made optional, but a couple remained. This
patch makes those also conditional on the feature being available.
Steven Hardy [Tue, 7 May 2013 14:59:49 +0000 (15:59 +0100)]
tests : convert test_template_format to test-local templates
test_template_format is different from all other tests, in that
we don't want to use the most minimal template possible, we
actually want to test conversion works with maximal/non-trivial
templates, so copy the two templates used by this test into a
local tests/templates directory, with a README caution that
in general inline-minimal templates are preferred.
Clint Byrum [Wed, 1 May 2013 22:51:03 +0000 (15:51 -0700)]
Wait for any nova server status that makes sense
Nova may return some transient states based on operator actions that do
not mean a resource has failed. Rather than report these as unexpected,
wait on them just like BUILD.
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.
Add alternative authentication middleware to authenticate against Keystone using
username and password instead of validating existing auth token. The benefit
being that you no longer require admin/service token to authenticate users.
To use, update heat-api.conf:
[paste_deploy]
flavor = standalone
This should make it possible to try heat out against existing public
clouds.