Removed redundant code in stack preview, create.

The operations performed for stack preview is a proper subset of
those performed for stack create, but the code is repeated.
Avoided the redundancy by creating a method and having it called
from preview_stack and create_stack methods.

Change-Id: I53d9f10913fcb49aa3fdb841b1fc893b8e401e4d
Closes-Bug: #1337718
Merge "Removed redundant code in stack preview, create."
Improve mocking in HeatTestCase

As the mock lib is going to be used more actively, there is a need
to improve our boilerplate code in respect to mock.

Changes in this patch include:
* `patchobject` method now uses `mock.patch.object` directly,
  without two layers of abstraction
  (those might be a crust from earlier mock days, but current mock
  does all that just fine by itself);
* `patchobject` now accepts kwargs and passes them to `mock.patch.object`;
* added `patch` method that uses mock.patch (similar to `patchobject`)
  - NOTE: this shadows `testtools.TestCase.patch` method that uses
    simple monkey-patching in favor of mock-based patching,
    relevant comment added in the code;
* test code changed accordingly where needed.

Change-Id: I779cab63249d5eb1962e9ec388cd31f3df4a4189
Fix monkey-patching occurence in a test

A test of Resource class was using a direct monkey-patching of a
generic resource class without cleanup. This has not resulted in an error
so far, but surely might in the future.

This patch uses proper mock for patching instead.

Change-Id: I9134dfc625e12df1ebcacda8373f81737fd59c2c
Add update_replace_allowed property attribute

Currently resources support only in-place update or (default)
UpdateReplace. In order to support AWS "Updates are not supported"
feature, this new property attribute is added.
It is going to be used for denying an UpdateReplace
behavior of the resource (similar to update_allowed currently).

Change-Id: Ie94241630d9595b58ff6b84bcb94459b0785fc03
Implements: blueprint aws-updates-not-supported
Check for update_replace_allowed in rsrc update

This patch adds check during resource update that the updated property
is update_resource_allowed. Otherwise update raises NotSupported error.

Change-Id: I91019cb34adfcbe67d8c802d4ce1ff7702656a7c
Implements: blueprint aws-updates-not-supported
Deprecate updates to AWS::EC2::VolumeAttachment

According to AWS docs AWS::EC2::VolumeAttachment resource does not
support any updates [1]. As updates to our AWS-compatible resource are part
of Icehouse release first issue a deprecation warning and leave a
comment in code to move the update logic to the native
OS::Cinder::VolumeAttachment resource after deprecation period.

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

Change-Id: I54d302dbec66ddd49c4a774376df99e7e9d63980
Partial-Bug: #1340096
Implements: blueprint aws-updates-not-supported
Move size update to Cinder volume

In order to align AWS compatible Volume resource with current AWS
behavior, this patch moves volume size extension to the native Cinder
Volume resource and marks all properties of the AWS::EC2::Volume resource
as not updateable even with UpdateReplace.

Change-Id: Ie1410d98175e1e42a95ca0fba72c48ca643a0dc7
Closes-Bug: #1340093
Implements: blueprint aws-updates-not-supported