Change Volume metadata attribute to raw dict.

Currently the volume metadata attribute is json
serialized, but outputting the raw dict is more
convenient for human users. This is fixed by
introducing a new attribute 'metadata_values'
whose output is in raw dict form. The attribte
'metadata' is preserved for those users who are
already used to its json serialized output.

Change-Id: Ib95656fa8632449957cd8c24b232f4d1b09a0e42
Closes-Bug: #1322007
Refactor service readiness notification

Build upon cceda95a35f18f5f7b52daaf0662a4cd3768b3ac apply Oslo systemd
module. It was imported in aef33d2d716c064f1f571c334fd36b1ea5928d5c. It
also drops heat.common.systemd and deprecates onready configuration
parameter.

Oslo commit 53e1214c092f09e3851b1a1b55289a93a72b09ec

Change-Id: I80f325c9be9c171c2dc8d5526570bf64f0f87c78
Remove unused functions from policy enforcer

The policy.Enforcer class has two functions which we don't use
anywhere, and the check function is broken due to an argument
mismatch with _check, so remove them until such time as they
are actually needed.

Change-Id: I25199fffeed5905b0673f137c70720ddb6dc48cb
Set python hash seed to 0 in tox.ini

New tox (>=1.7.0) sets a random python hash seed by default. This is
generally good for testing because it will help keep projects working
regardless of the hash seed, but heat unittests don't currently pass
with a random hash seed so set it to the python default seed.

This change will allow us to use new tox again and remove the
restriction on tox<=1.6.1 to run unittests.

Redundant setenvs for specific test envs are removed to prevent them
from overriding the PYTHONHASHSEED value.

Note this change will need to be backported to the stable branches to
keep unittests there working with new tox as well.

Change-Id: I2370759546adee7bf5e20fa214ed7fa1f31d6bfe
Parse RST in plug-in class docs

In order to make the generated documentation for resource plug-ins more
readable, parse the class comments as RST and append to the section.

Change-Id: Icb37344c64c21bcac536e8f2916b102eb9754851
Add "index_var" property to the resource group resource

This property allows a template author to replace values in the
nested resource_ref with the index of the specific instance of
that resource in the group. This allows a user to, for example,
add the index of the resource to server names in order to make
them more easily distinguishable when listed outside of Heat.

Implemements: blueprint override-resource-name-in-resource-group
Change-Id: I4339067e3b8927573acff0ab5968de61a3253d07
Retry resource create until success

On resource create, if a ResourceInFailure is raised then
repeated attempts are made to delete and recreate the resource
until success or a different error state is achieved.

Likewise, the prepare-retry deletes will be retried until
ResourceInFailure is not raised.

An exponentially increasing delay with jitter is introduced
between each create attempt, and attempts continue up to the configured
action_retry_limit or stack operation timeout.

Likewise An exponentially increasing delay with jitter is introduced
between each prepre-retry delete attempt, and delete attempts
continue up to the configured action_retry_limit or stack operation
timeout. The delete attempt count is reset to zero whenever a create
attempt has been performed.

Creates that result from an UpdateReplace will also go
through this path, so this is also helps some stack update scenarios.

This change is aimed at being part of an interim solution to making
heat resilient to transient cloud failures. Convergence is the
permanent solution however there may be benefits to the convergence
implementation from this interim effort.

Currently retry is only attempted on ResourceInFailure. Eventually
client plugins can indicate whether a given exception should lead
to a retry attempt (such as connection errors, some 500s).

Partial-Blueprint: retry-failed-api-calls
Change-Id: I07c3301349bcd24096f3cafbb6d82c43bccb93de
Add RPC method to snapshot stacks

This adds new methods to snapshot a stack and manipulates snapshots.

blueprint stack-snapshot
Co-Authored-By: ala.rezmerita@cloudwatt.com

Change-Id: Id3dafef3c2c04cd43c3094283dceece26834a5e1
Restore resource_id from backup_stack

When UpdateReplace is occurred, the resource is moved to backup_stack,
and create new one. Then, resources which has dependency for updated
resource will be moved to backup_stack.

If the creation of update is interrupted by some reason(e.g. heat-engine
down), dependencies between backup_stack and exist_stack will exist.

Heat deletes backup_stack before deleting exist_stack. The dependency
still exists, so it will be failed. Thus, add behavior that restores
resource_id in the backup_stack when the stack is deleted.

Change-Id: I32cecba17ae160d4631fb2611e34b91bb921dc5e
Closes-bug: #1334514
Merge "Retry resource create until success"
replace dict.iteritems() with six.iteritems(dict)

According to https://wiki.openstack.org/wiki/Python3 dict.iteritems()
should be replaced with six.iteritems(dict).

Change-Id: I9e2881a006433c8b44a3caccebc73bae4973a041
LaunchConfiguration replace on changed Metadata

This makes AWS::AutoScaling::LaunchConfiguration raise
an UpdateReplace if its template Metadata is changed on a
stack update. Any changes to LaunchConfiguration should result
in the resource being replaced, since this is how those changes
propagate to the scaling group.

This fixes a regression which has likely existed since
update_allowed_keys was removed: I78494aba07b6badeca8e95f1875ca8e4b9b0290c

Change-Id: I3a53422ed862777dffb9cac28088fbfe8dd417fa
Closes-Bug: #1287953
Fix dead link in cfn template doc

The link referenced in templates/cfn/WordPress_Single_Instance
is dead. Looks like the directory was restructured. Updated using
a like for the F18 version of the template.

Change-Id: I46705cd31e2be6f3f131c64944665eabe6347dc9
Always convert string type params to string

Schema.to_schema_type() should convert values passed to it to the
appropriate type.  So if the user passed a version number of 9.4 and
they defined it in the template with a string type, we should get the
string '9.4' back, instead of the error "The value '9.4' is invalid for
type 'string'".

Co-Authored-By: Richard Lee <rblee88@gmail.com>
Closes-Bug: #1353701
Change-Id: If7abd129dc7819c6ac01f9bf7dfdbe397ec09c65
Merge "LaunchConfiguration replace on changed Metadata"
Merge "Restore resource_id from backup_stack"
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` 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 config file for performance gate job

This job is called gate-rally-dsvm-fakevirt-heat.
Also added readme and plugin sample.

Change-Id: Ic4f482e566f3552b3fdf7129b8447e7def036441
Merge "Refactor service readiness notification"