Fix docker volumes binds issue

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

Closes-Bug: #1322205

Change-Id: Ie8eff402e8714f3c5d478dbc9fc02b43a377dccd
Patch 033 migration to work w/ MySQL 5.6

With MySQL 5.6 setup to use UTF-8 for everything, the 033 migration
will fail. This is because a VARCHAR(256) cannot be indexed in UTF-8
databases. In versions of MySQL before 5.6, this produced a warning and
a truncated, less-useful index. In 5.6 it was changed to an error.

We will reduce these columns further to 64 bytes in the model in a
subsequent fix. For now, we will just create the table with 64 character
columns on new systems, which will allow this migration to work properly
on mysql-5.6. There is no danger of overflow, as 64 chars is what Keystone
uses for them anyway.

Change-Id: I27b9c61828301ba8c392b3d316f656641af753bc
Closes-Bug: #1316646
Stop overriding CONF.default_log_levels per binary

Overriding CONF.default_log_levels means we loose some explicitly set
default values such as 'iso8601=WARN'. Also explicitly overriding
CONF.default_log_levels means that default_log_levels cannot be set in a
config file.

Change-Id: Ib5103b88ec3f9ccd9d516032c6a13dc2fa4bcb5e
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
Add a OS::Nova::ServerGroup resource.

Change-Id: Ia6dc596b3ddcfb29dfe8f712794584fb2f6954ca
Implements: blueprint vm-instance-group-support
Guaranteed password complexity using OS::Heat::RandomString

This will allow users to generate passwords for applications that have
specific password strength requirements.

blueprint random-string-complexity

Change-Id: I801b4b46e1b9a872a02695176f6b7ab6b9a5f19d
Pass the context when updating raw_templates

Without a context, the raw_template was being stored using a different DB
session, with the result that changes did not end up in the database.

Also, don't use the same raw_template DB entry for the backup stack, since
that causes competing modifications to the DB that break rollback.

Change-Id: I6c71c19acac0b87943f36c57c2300cf2b0478aa3
Closes-Bug: #1331872
Related-Bug: #1291905
Related-Bug: #1206702
Related-Bug: #1328342
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
Deprecate direct access to clients methods

This change deprecates access to methods like clients.nova()
replacing them with calls to clients.client('nova')

This allows the memoization to be done in one place (the client()
method) and also establishes the preferred API for accessing clients
that are contributed by plugins.

All calls should now be going through the new client() method.
Any calls to the old methods will result in a deprecated log
warning.

Change-Id: I3dc45aaed2655536ed1558e03f468b0733527815
Make heat.engine.clients a package

As blueprint client-plugins progresses, the code in __init__.py
will move into plugin modules, until the only package initialising
code remaining will be the following:
- plugin initialise
- Clients class which memoizes client plugins for a given context
- deprecated clients methods (until deleted later)

Partial-Blueprint: client-plugins
Change-Id: Ic8f67e3519b10c0d3d204e15e5ad72376c50a1dd
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
Catch NotFound for every stack delete db operation

A stack delete can be interrupted by another delete request
at any stage, so a stack may be in any state of partial deletion.

This change ensures that every db operation in a stack delete
will catch NotFound exceptions so that the delete process can
continue.

Change-Id: I3b665acbc7979147f24793a314da37150d4efeb8
Partial-Bug: 1328983
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
Merge "Guaranteed password complexity using OS::Heat::RandomString"
Updated from global requirements

Change-Id: I8947fe9a024ed9ac546473b21546584961b422e8