Add log output about HTTP calls in cinderclient

This patch enables heat to output the details of requests
to cinder and responses from cinder
(including 'x-openstack-request-id' in the response header)
to the log.

Change-Id: I714c87e538bc3a51dce6a48e584824cf7f954bcf
Closes-bug: #1329613
Appropriate exception for signal handling failure

Raise an appropriate exception, mapped to a 400 error for signals
to resources which cannot handle signals.  In this case, the request
is inherently impossible to satisfy, because the plugin doesn't
support signals, so we should alert the user to this by saying it's
a bad request (rather than the current response which is a 500 error)

Change-Id: I8e47ee94e15309f378f62f2a9f6534a4eeddb389
Closes-Bug: #1346849
Fix DBError output in test logs

After patch If48ba9d3deb54f8e9ea1ed1987f832ddbaed33fc a (non-fatal) DBError
is displayed during unit tests run.
This patch fixes that by proper mocking (and stops mixing mock and mox
in single unit test).

Change-Id: I2bd857492d2fca7f3683f7b7a6b062e3dddcbeed
Template get_version breaks with Template object

The get_version method on template expects a dict, breaking
stack preview. This patch modifies StackResource preview
to always call the Template constructor with a dict

Change-Id: I6e75a78b4d496e235f11ec3d94ee58a069ab5336
Closes-bug: #1351005
Implement check for Instance resource

Instance resource will raise an error if it's not active at the time of
the check.

Co-Authored-By: Richard Lee <rblee88@gmail.com>
Implements: blueprint stack-check (partial)
Change-Id: Id34b461f5c76187928dd0419d8537e9a6cb6178c
Allow listing of resources from deleted stacks

This change complements the `show_deleted` flag added to stack-list and
allows for resources in a deleted stack to be listed as well.

Implements: blueprint stack-list-soft-deleted
Change-Id: I20ac5cb1039d12e4df30a01491f6ce15b5154f5b
Adding validation algorithm for get attr functions

Turn on validation for functions Fn::GetAtt and get_attr.
Validation will be skipped if resource has overwritten FnGetAtt method.

Related-Bug: #1273490
Change-Id: I15b6b7447face0cf2fe1d6059d3fb900778b66cc
Using default FnGetRefId behavior for LaunchConfig

FnGetRefId of LaunchConfig returns only physical_resource_name, but in
the case where a resource is not created, resource.id equals None. So the
result of FnGetRefId will be None too. It gives unpredictable behavior
during preview, when other resources return None too.

Change-Id: I425f777dbd0600e35354b0d5308cdaf701d85119
Closes-Bug: #1324493
Move VolumeAttachment updates to Cinder resource

According to AWS docs AWS::EC2::VolumeAttachment resource does not
support any updates [1]. Support of updates in our AWS-compatible
resource is a bug and needs to be fixed without deprecation period.

This patch moves VolumeAttachment update logic to native Cinder
resource.

[1] http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volumeattachment.html

Change-Id: I54d302dbec66ddd49c4a774376df99e7e9d63980
Partial-Bug: #1340096
Add "backup" column to stack table

Adds a backup boolean field to the stack record, defaulted to False,
with a migration which sets it to True for existing backup stacks,
which are named stackname* (which is an invalid name for any non-
backup stack).  Also adds the related column to the DB model and the
Stack object, so when we store a backup stack the flag will be set.

blueprint: list-nested
Change-Id: I737596a7248e8dd0c18a3f444f3b39a2b2e966c8
Native WaitConditionHandle move to common curl_cli

Move to a common curl_cli attribute, which can be used for both
success (default) and failure (by passing appropriate status data,
and optionally reason).  This should allow a slightly more flexible
interface than the current success/failure attributes, while still
remaining simple, and enabling simpler portability between this and
the alternative Swift signal implementation.

Note this breaks compatibility with the attributes we just recently
merged, but I'm assuming since it's so recent nobody is using it yet.

The example template at https://review.openstack.org/#/c/106424/ has
been updated to reflect the new interface.

Change-Id: Iac09aaa60ef5c1de27c9eeca7c65eca41c06907e
blueprint: native-waitcondition
WaitConditionHandle resources, create events with reason data

Return data describing the status and reason for the signal when
handling a signal for a WaitConditionHandle resource.  This enables
an informative reason to be included in the event associated with
the signal created in resource.Resource.signal, currently it is
always "Unknown"

Change-Id: If504fd49a479f783e034ff908ecdf785faaac265
Partial-Bug: #1340894
Return metadata from resource_signal RPC interface

To enable us to completely remove the metadata_update call without
breaking the current CFN waitcondition API, we need to return the
resource metadata, like metadata_update does (currently we don't
return anything when handling a signal).  This should not be
expensive as the metadata has just been updated, thus should be
cached inside the resource object.

Change-Id: I29bf6f9f5fab133b06ab8ecc92d7556a9bb6e35a
Merge "Appropriate exception for signal handling failure"
Merge "Implement check for Instance resource"
Implement snapshots for servers and volumes

This provides the snapshot facility for server and volume resources.

Implements: blueprint stack-snapshot
Co-Authored-By: ala.rezmerita@cloudwatt.com
Change-Id: Id5e63f1a0081e29dc84bd1b71f9d40ae672877f6
Merge "Native WaitConditionHandle move to common curl_cli"
Merge "Template get_version breaks with Template object"
Merge "Fix DBError output in test logs"
Convert AWS Route Table and association to use clients.

Changed client calls to properly use the new client plugin mechanism.

Change-Id: I7fba8e9adf1801993c815565f567a07603bb2bd8