Fix exceptions in update_stack

Updating an in-progress stack is not supported by Heat.  Previously, a
NotSupported exception would be raised.  This was not consistent with
other actions, such as abandon stack.  Instead, let StackLock.acquire
raise an ActionInProgress exception.  Suspended stacks will still result
in a NotSupported exception being raised if an attempt is made to update
them.

Closes-Bug: #1308109
Change-Id: Ic844b06cd654d7bd5d422bba81d1d8246a5d8dd0
Avoid double-initialisation of Resources

If a __new__ method returns an instance of its own class (including
subclasses), Python automatically calls the __init__ method on the instance
before returning it to the caller. Therefore, explicitly constructing a
subclass inside __new__ and returning it was resulting in __init__ being
called a second time. Instead, call object.__new__(), passing the subclass
that we want to instantiate.

Change-Id: I5f891fd97e4cabc6d4c39c5312a0185649702e75
Unit tests: Create resources with ResourceDefinition

Stop creating Resources with dicts that are snippets of templates, and
instead always use ResourceDefinition objects to create Resources.

Change-Id: I1587f1edf9b04f06bd435857d7c1ea2c1cc26058
Use ResourceDefinition in autoscaling

Compare resources using ResourceDefinition objects (which are both
comparable and hashable, and are independent of any one template format)
instead of passing around snippets of a template.

Change-Id: I3bb8bcd2ff54a699a901aac435a56b537d99e992
Handle HOT when converting Outputs to Attributes

When converting the Outputs of a provider template into Attributes of its
facade resource use the Template object (which translates the template into
a consistent, cfn-like format) instead of the raw template data, so that
HOT also works.

Also fixed an outdated (and therefore now misleading) comment.

Change-Id: Iba44ba56be3e1d756cdc01a2b6f4fba171a02057
Support passing a Template object to StackResource

The create_with_template() and update_with_template() methods of the
StackResource class previously took raw template data as an argument; this
change allows them to accept Template objects also.

Change-Id: I7af5d516d4d0c4085144ed53c962cfc6ca3c69bb
Allow a resource to be added to a template

Add a method that allows a ResourceDefinition to be inserted into an
existing template.

Change-Id: Ia418127d72d26a77d731f93cc0eb3a45d983cc82
Merge "Avoid double-initialisation of Resources"
Merge "Unit tests: Create resources with ResourceDefinition"
Merge "Use ResourceDefinition in autoscaling"
Merge "Handle HOT when converting Outputs to Attributes"
Merge "Support passing a Template object to StackResource"
Merge "Allow a resource to be added to a template"
Merge "Fix exceptions in update_stack"