Fix docker volumes binds issue

Without the fix, the volumes will not be attached after the container
started.

Closes-Bug: #1322205

Change-Id: Ie8eff402e8714f3c5d478dbc9fc02b43a377dccd
Re-organise top-level template guide structure

The current structure must be baffling for new template authors.

First is a section on Environments, which is actually an advanced
topic. Then is a section on cfn compatible functions which users
should be spurning in favour of HOT intrinisic functions.

The actual docs on how to write a HOT template and the HOT spec
is buried at the end.

This change remedies this state of affairs by moving the
Heat Orchestration Template (HOT) Guide to the start, followed by
the HOT spec.

The Environments section is now after the resource types, and the
Functions section has been renamed CloudFormation Compatible
Functions.

How we document CloudFormation coverage probably needs to be
rethought, but that is beyond the scope of this change.

Change-Id: I2ef2568309427b37555bae3d6b24a1464a7379b1
Use auth_token_info to initialize heat_keystoneclient sessions

Now we have the token info available in the request context, we can
avoid always re-requesting another token every time a client is
created.

This should be better for performance as it avoids one extra request to
keystone, and it also enables trust-scoped tokens to be more easily
used, since these cannot be used to request another token, thus
authentication will fail with the current scheme.

Change-Id: Id34a4104cedbd3f1c231bc0b9229a5cac7bb9402
Partial-Bug: #1317293
Support loading constraints as stevedore extensions

This still maintains support for the existing mechanism
but moves the in tree constraints to using stevedore.

part of blueprint stevedore-plugins
Change-Id: I86907e6518281083a508f840269d79dfa3875e9a
Change template loading to use stevedore extensions

part of blueprint stevedore-plugins
Change-Id: I71ebea421e8eb517a00e10a7e10b63ba7667fc4c
Sleep before stopping threads for delete

The logged error in bug #1328983 occurs in the following scenario:
* single heat-engine (so no multi-engine locking paths are invoked)
* multiple stack deletes on the same stack
* when the threads are stopped from a previous delete call so
  that the new delete call can acquire the lock and do the delete

This change does an eventlet sleep before forcefully stopping
the thread when taking over a delete from a different
thread. This gives the previous delete thread an opportunity to
finish naturally.

This may not prevent the error in bug #1328983 from ever
being logged in a production environment, but it is an internal error
which does not propagate to the user. This change should however
prevent this error from being logged during a tempest run, and the
original gate failure was due to ERROR log entry detection rather
than actual failing tests.

By experimentation the timeout of 0.2s was chosen. The error in
bug #1328983 started being logged again when the timeout was
reduced to 0.02s

Closes-Bug: #1328983

Change-Id: I8f95f29bd238e097ed9f4b889afe12c88d193240
Avoid truncating API Response

Removes unnecessary escape characters from an exception message so that
it does not get truncated by the fault middleware in the wsgi pipeline.

Closes-Bug: #1335807
Change-Id: I20281042e617199b1f5a0507c56adca6a6dc601f
Implement Flavor Extra-specs Key/Value Pairs

Add flavor set_keys function to nova_flavor resource.

Change-Id: I5d46ace4d729a2c4a1b136265b146417e7ad2812
Makefile option to build xml docs

Change-Id: I15316f7a8e3fef679c9b322ef34d94848715b206
Support using domain_name instead of domain_id

When using keystoneclient (heat.common.heat_keystoneclient) to
perform actions, support the use of domain_name instead of
exclusively domain_id.

The new config option to use domain_name instead of domain_id
is ``stack_user_domain_name``. If ``stack_user_domain_id`` option
is set (renamed from ``stack_user_domain``), the new
domain_name-specific option will be ignored.

Change-Id: I0d3937a98b95100ccaaaf7a46d3ed722aba27de3
Closes-Bug: #1313003
Refactor waitcondition resources to allow easier subclassing

Rework the WaitCondition resources to define some class variables
which will make inheriting from them to implement native resources
easier.

Change-Id: I518bc112cda78a64f079da582be6dc1e3fd00baa
blueprint: native-waitcondition
Base class for client plugins

Subclasses must implement the _create method which is only called the
first time client() is called. A reference to the Clients object is
stored to allow client plugins to access other plugins.

auth_token and url_for are utility methods which can be called by
subclasses or elsewhere in heat.

_get_client_option is a private utility method for subclasses.

Change-Id: I5f890a3632b65a8cb534e0cf4dac858166bc168a
Order intrinsic function docs alphabetically

The current order appears to be arbitrary. There is no other obvious
natural order so this change reorders alphabetically by the name
of the function.

Change-Id: Id1b0f02b8fb77f4e55827d962e3463d05245e564
HOT intrinisic function list_join like Fn::Join

We have an increasing number of attributes which are a list of strings.

In HOT there is no way to join a list into a string as with the CFN
function Fn::Join.

This change implements HOT intrinsic function list_join using an
identical implementation as Fn::Join.

Tripleo will benefit from this function since the lack of a join
function in HOT is one of the barriers to transitioning to the
HOT template format.

Change-Id: I29e0b744271213429fff6922397b925eb9ccc204
Improve OS::Trove::Instance resource

Improvements include:
- better handling of possible Trove instance states;
- usage of proper troveclient exception;
- better error messages;
- setting length constraint on user databases property;
- NAME property is no longer required as it can be autogenerated;
- name autogeneration fixed to prevent the like of bug #1324499;
- simplification in tests by removing environment in test template;
- some typos fixed.

Change-Id: I27c569a16a316448001d857e839c9aabc28ca611
Add datastore properties to OS::Trove::Instance

Latest Trove supports datastore type and datastore version options
when creating Trove instances. This patch enables their usage in Heat.

Change-Id: I1d037a9fbf66f13c3195a55c7325d19b5e9a058c
Closes-bug: #1257690
Merge "Refactor waitcondition resources to allow easier subclassing"
Merge "Order intrinsic function docs alphabetically"
Merge "Re-organise top-level template guide structure"
Revert "Refactor waitcondition resources to allow easier subclassing"

This reverts commit 850ac0c1b552d2bae91d5718df56c3e3a739b2f5.

One of the prior two commits prior are causing Metadata to come back empty
after signals are processed. This must be reverted because it conflicts
with those commits.

Change-Id: I37c11e3b7e4c7528ebd21736ed4a32288ff4e77e
Partial-Bug: #1337772