Remove instance in ERROR state after failed create

If a VM was created but resulted in a nova error, the VM would enter
an error state and not be deleteable via heat delete.  Instead
the VM would persist after the delete operation.

Change-Id: I9135aefdf08aba9551f9290bd072906372583ed1
Fixes: bug #1099634
Add a convenience method for deleting nested stacks

Add a convenience method to the stack.Stack abstract resource class for
deleting the underlying nested stack.

Change-Id: Ic91b1ebb2f358e40d9e201264944924045a1b044
Signed-off-by: Zane Bitter <zbitter@redhat.com>
Move abstract nested stack class to separate file

The class heat.engine.resources.stack.Stack is intended to be an abstract
class which resources that are implemented as nested stacks may inherit
from. Rename it to StackResource and move it to the
heat.engine.stack_resource module, so that other resource modules
(including plugins) may include it without having to also import the
NestedStack class (which implements the AWS::CloudFormation::Stack resource
type).

Change-Id: Ie7c05ec64e1c9632c7a24d96b5d790c9e50b691f
Signed-off-by: Zane Bitter <zbitter@redhat.com>
Don't inherit from NestedStack

The NestedStack class is intended only to be the implementation of the
AWS::CloudFormation::Stack resource type. Other resources whose internal
implementation uses a nested stack should subclass the abstract
StackResource class.

Change-Id: Ic311c220dbf9bdf539d68f4004c8dc14752e057e
Signed-off-by: Zane Bitter <zbitter@redhat.com>
Get rid of unused initialisations in Resource

The clients have all been moved out into the Clients class; these were left
behind.

Change-Id: I5831198cf3c2a7ef8cb9524960643d4adf310b3f
Signed-off-by: Zane Bitter <zbitter@redhat.com>
Fix duplicate naming in unit tests

This bug brought to you by the letters C and V.

Change-Id: I375f628f3e36f4b1723dc8ccc99b0475a02c152c
Signed-off-by: Zane Bitter <zbitter@redhat.com>
Prepare the groundwork for more exception types

We have been abusing AttributeError and ValueError rather than raising
exceptions that actually describe the problem. This opens the way for
changes that will allow us to handle a wide variety of specific exceptions.

Change-Id: I05c99601d4e877878195e658908fffa0e126f06c
Signed-off-by: Zane Bitter <zbitter@redhat.com>
RPC API: Add an InvalidTenant exception

Change-Id: I0bd91c3ba15166d728f9e0570f787fdcc6a1cdc6
Signed-off-by: Zane Bitter <zbitter@redhat.com>
RPC API: Add a StackNotFound exception

Change-Id: Ic109e9f6f5cca3af531ffcd2c9149742442e66d4
Signed-off-by: Zane Bitter <zbitter@redhat.com>
RPC API: Add a StackExists exception

Change-Id: Ia8cb5af80abc7570b938c381d51e41eb7aa0629d
Signed-off-by: Zane Bitter <zbitter@redhat.com>
RPC API: Add a ResourceNotFound exception

Change-Id: If55cd6ca0eab8be9d192e76430aedf1d5a1767c3
Signed-off-by: Zane Bitter <zbitter@redhat.com>
RPC API: Add a ResourceNotAvailable exception

Change-Id: I7f535b7823288b74cbe27f43b645a8d0f3180905
Signed-off-by: Zane Bitter <zbitter@redhat.com>
RPC API: Add a PhysicalResourceNotFound exception

Change-Id: I409f8df9e93809f7267fb09656302082e42753da
Signed-off-by: Zane Bitter <zbitter@redhat.com>
RPC API: Add a WatchRuleNotFound exception

Change-Id: I7abda2fb745b84925edf685b7fced3541d94a8db
Signed-off-by: Zane Bitter <zbitter@redhat.com>
ReST API: Clean up exception-handling cruft

Now that we have explicit exception types indicating when a resource is not
found we don't have to rely on knowing which call the error was from.

Change-Id: I54ebce7cb68e551852fd87d51b57b26536cde136
Signed-off-by: Zane Bitter <zbitter@redhat.com>
Merge "Remove instance in ERROR state after failed create"