fixes stack deletion failure, when vol in deleting

when an delete operation is requested on a stack, and the volume in stack
is already in 'deleting' state, heat fails to delete the stack and goes to
DELETE_FAILED state instantly.

Instead of going to DELETE_FAILED state instantly, heat needs to safely
wait for the volume to complete its deletion process, so that heat can
then go ahead and complete stack deletion successfully.

Closes-Bug: #1362708

Change-Id: I088eab90bee4bc804abe9e505fd61b17b266def1
Import the stack module directly

Note: the patch imports "stack as parser" in some places to maintain
API (service.py and event.py).

Change-Id: I0409a04789f0ca362cb9ab0b612d47226d785334
Fix outdated comment in KeystoneClientV3.

This patch fixes the outdated class comment for KeystoneClientV3.

Change-Id: I7735dd8b2c672cf9e40d01a6a72fd90f1540352a
Resolve AWS::EC2::Instance AZ output to a value if not specified

The availability zone output attribute of the instance resource is
empty if no input is provided by the user for that property.
Instead of relying on solely user input to determine the value for this,
this attribute must be resolved to an appropriate value.

The VolumeTest.test_volume_default_az test case had an unmocked function
which is now mocked here to successfuly test this feature.

Change-Id: Iab2cf1f3da0261c30b755d0b87ebb693644a4a29
Closes-Bug: #1334519
Fixed adopt failure for stack with resource group

Added support to adopt a resource group and corresponding
unit test.

Change-Id: Icfeff0e30a9c4bd7fa0279e156709e078b81fcab
Closes-bug: #1353942
Hard delete backup stack after successful update.

After successful update of a stack, the backup stack and it's associated
template, resources and events should be permanently deleted.

Closes-Bug: #1332300

Change-Id: I3a462690b5f6bfadfbcf16eeb6bdec7c5ece2e83
Updated from global requirements

Change-Id: I2d0250cbb41d79d0210964f7f99c1c6eeeef1257
Use host information passed while starting service

While starting the heat engine service, the host parameter value
being passed to EngineService should be used instead of referring
the conf.
Similarly in the case of EngineListener.

Change-Id: I365f7e21637776d2e7da7685790758f3dcd06989
doc: Improve use of the support_status attribute

This patch adds admonitions to the template_guide to indicate support
status of resources to the reader. Deprecated resources will be clearly
indicated, as well as the version in which a resource appeared.

This patch also rework the generated markup to use paragraph nodes
instead of inline nodes inside notes.

Closes-Bug: #1360561
Change-Id: I5ee9fd47f0aa9627beb842dc46aa3bac10060e13
Associate floating IP with router interface

This change will create a dependency from a FloatingIP to a RouterInterface in
this template which interfaces with the same subnet that this FloatingIP's
port is assigned to.

It would be preferable to add the dependency based on matching FloatingIP
floating_network_id and Router external_gateway_info network, but there is
a valid use-case for the Router being external to the template, so the
dependency is matched on the internal subnet instead, which is available
from the RouterInterface property.

Change-Id: Iedff00b382b4fcda741ca5c9b4adc23b176ec48c
Closes-Bug: #1299259
Commit transaction on object delete

The postgres gate jobs currently have an intermittent failure
where a deleted resource shows up in the resource list.

This change does a transaction commit on object delete, which
brings delete behaviour in line with soft_delete behaviour
(soft_delete uses update_and_save, which also commits).

Change-Id: I5e1be4c197863fde3149c964f992ad816db88b7e
Closes-Bug: #1370865
Use six to translate exception message in tests

Use six to translate exception message in tests

Change-Id: I129de2f350ef31c6a8ef10355ada20d7789049a9
Add test to serialize and deserialize exceptions

Every subclass of HeatException is serialized and then deserialized.
For those classes which don't have a special init method, a generic
inspection is done to test each class. There are four exceptions
that are different, so their arguments are manually constructed.

Change-Id: I9bb21d134f8997c478cd4ee8ef0031e03b053204
Closes-Bug: #1304743
Support classes for heat integration tests

These support classes started as a forklift of the classes needed
to run tempest scenario orchestration tests.

The original tempest code has been pared back to provide the
small subset required by heat integration tests. From this point on
these support classes can evolve to the specific needs of the
integration tests.

There is some unused code (especially in remote_client) which has
been left in as it may become useful in the future, and is already
extremely well reviewed and tested from being developed for tempest.

The script heat_integrationtests/generate_sample.sh will generate
an up-to-date heat_integrationtests/heat_integrationtests.conf.sample
file which can be copied to
heat_integrationtests/heat_integrationtests.conf
to override default configuration values. A local ConfigOpts is created
for each test to avoid any potential interaction with heat's
global CONF. Configuration options for credentials default to
being sourced from the environment.

The default tox testenv now excludes tests in heat_integrationtests.
A new testenv called "integration" will only run tests in
heat_integrationtests.

Integration tests will fail if preconditions are not met, including
a keystone endpoint, credentials and glance containing the expected
named image.

Devstack gate hooks have been moved to heat_integrationtests now that
the name of the package has been decided.

Change-Id: I174429c16bb606c5c325ee8b62c6e600ea77a6e6
Partial-Blueprint: functional-tests
Merge "Fix outdated comment in KeystoneClientV3."
Convert parse error to text type

Some local environments (but not yet the gate) are experiencing
failure of InstantiationDataTest.test_format_parse_invalid_message.

This change fixes that test by converting the parse exception to
a text type before including it in the error message.

Change-Id: I06e271559e27452a7a0c1e8807a37bb5ed5df2fa
Closes-Bug: #1365880
Default port policy to force replacement

This change adds a replacement_policy property to OS::Neutron::Port
which defaults to always replacing the port on stack-update
regardless of any changes to the template.

Currently when a server is replaced, the new server is booted with
the port that is still attached to the old server, which raises a
port-still-in-use error.

Even if heat managed to detach and attach a single port, Nova currently
deletes all ports on interface-detach and server delete, so the port
would no longer be available anyway.

This change ensures that a new server is always booted with a new port,
so it fixes the above 2 issues, however there are implications for
other scenarios.

If the server is not replaced during the stack-update, the server
handle_update will detach/attach to the new port, so this is fine.

If the port specifies a fixed_ips ip_address which doesn't change
during stack-update, an error will be raised that 2 ports exist
with the same IP address. The only current workaround would be
to set update_policy:AUTO and not make any changes to the server
which results in server replacement (or do 2 stack updates using
a transition ip_address).

Likewise, update_policy:AUTO will need to be set on any port
consumed by resources which don't support update without replacement
(such as OS::Neutron::FloatingIP and OS::Trove::Instance)

Change-Id: I558db6bac196f49e5c488a577f0580c934b06747
Closes-Bug: #1301486
Related-Bug: #1158684
Related-Bug: #1369748
Merge "Use six to translate exception message in tests"
Imported Translations from Transifex

Change-Id: I19bfda97442507da24417228c0bdfa5ba979cf34
Merge "Convert parse error to text type"