Patch 044 migration to work w/ MySQL 5.6

With MySQL 5.6 setup to use UTF-8 for everything, the 044 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: I73932f69ff662ef5bb030b6516bd3d32507de658
Related-Bug: #1316646
Fixed resource errors logged at default log level

* Heat was logging resource failures traceback at default log level.

* Resources failing is a normal condition, and once a resource has failed,
heat has already reached one of the permissible state ex: CREATE_FAILED,
hence heat should not log the resource failures traceback in default log
level.

* Have made necessary changes to log resource failures traceback at INFO
level.

Change-Id: Ica27cac5a94734c2db08cee2e7fe31289169fec9
Closes-Bug: #1290565
Fix signal handling for WSGI servers

Previously, sending a SIGHUP to the parent process would close the
shared socket used with all the WSGI servers (problematic when multiple
workers are present). Also, exiting the wait loop in the parent would
cause the children to be orphaned. Instead, make the parent process
restart all the children servers upon receipt of SIGHUP. This behavior
seems to make sense given that sending SIGHUP to a child restarts and
creates a new server (due to the parent handling of the children).

Another fix was to issue a SIGTERM upon Ctrl-C in order to not leave
parentless children. SIGTERM was chosen instead of SIGINT simply to
avoid worker tracebacks on the terminal.

Minor unrelated change: the WSGI server in single worker mode has been
changed to also respect the debug flag, exactly the same as with
multiple workers.

Note: the original bug report was examining lack of signal handling
based on the Oslo service code. However, only the engine makes use of
it.

Change-Id: I8519cc6fedf72b38a8ce0762bb86cd70e58e0dc7
Closes-bug: #1276694
Add controller and action debug message in wsgi.py

Add controller and action debug message before calling api
controller to provide much more debug message when debugging api.

Change-Id: Ia1d05a3fd3574a63571838b6eb60f4db5bfef7f4
Implement custom constraints for subnet/port/router

Implement custom constraints for subnet/port/router

blueprint neutron-custom-constraint
Change-Id: I2d463512b0c19bd02ef0629a38a97dddfd4a1cfe
Add backward compatibility for notification_driver

Declare additional entry points for notification_driver option to avoid
breaking existing deployments that may use deprecated values.

Change-Id: I4f6abc33d01bb434d8ea9895aea2bfe6324049eb
Closes-Bug: #1355250
Man page for heat-keystone-setup-domain

This patch adds a man page to the 'heat-keystone-setup-domain' utility.

Change-Id: I8f92b1296ab1f61039214d7fde4f7a2a236e8893
Closes-Bug: 1326483
Move CooldownMixin into separate file

CooldownMixin is a class that can be shared between OS and AWS
auto-scaling implementations.  This patch moves it to a shared
subdirectory.

Implements: partial-blueprint reorg-asg-code
Change-Id: I40e470460e84944d317f5b1772fc562abf62896d
Enable lazy translation on heat

Enable lazy translation in heat/__init__.py so that heat
exception message can be actually handled and translated.

blueprint i18n-messages

Change-Id: I009bd95ece44afb841d1732395d6a4769bc52f35
Silence urllib3 redundant logging.

This patch makes the default logging level of heat-keystone-setup-domain
to be WARNING and the 'urllib3.connectionpool' logging level to be
WARNING as well.

The intent is to remove unncecessary logging information from urllib3
library.

Closes-Bug: 1358093
Change-Id: I650e80aa1093c8c7e7c5dac3694d58139d2ec260
Provide access to outputs from OS::Heat::AutoScalingGroup

Allow get_attr on OS::Heat::AutoScalingGroup to return a list of
corresponding attributes from each of the base resources. For example,

  {'get_attr': ['my_asg', 'outputs_list', 'networks', '<network_name>', 0]}

will return a list of the first IP address assigned to each server in the
group. This is modelled on similar functionality in the
OS::Heat::ResourceGroup resource. Similarly:

  {'get_attr': ['my_asg', 'outputs', 'networks', '<network_name>', 0]}

returns a mapping from resource names to the corresponding IP addresses.

Change-Id: Ib9e830e0c54602ac456d64179e1df30f0778906d
Closes-bug: #1356544
Implement snapshot listing

Add a new HTTP API to list a stack snapshots, along with the new method.

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

Change-Id: I59eb7e035c19d2734c89a79848dec35f4468a1a0
handle_signal to handle translated error msgs

Heat software config deployments, when they fail, in some
circumstances pass translateable Messages as their error output.

Patch converts messages to unicode rather than str.

Change-Id: Idd325c80b68a69d11cea306bd6980518f0948196
Closes-Bug: #1332355
Remove the unused doc path heat/doc

Resource doc generation has been moved to doc/source/ext.

Change-Id: I7709e9f98aac8de7619ab6eda8a5f8b0488af67c
Use oslo.config>=1.4.0.0a3

Change-Id: I1f10074c72a0da0cbe6536f1e426aeaf4ae50f1e
Use empty list in list_join for validation

Calling list_join on the list of ResourceGroup's attributes in a
SoftwareConfig fails during template validation with:

ERROR: Property error : my_config: config "list_join" must operate on a
list

Closes-Bug: 1358831
Change-Id: I39d2da7a28ba53fbe3a95bff0198fa5c2f87aa3b
Use auth_token from keystonemiddleware

auth_token middleware in python-keystoneclient is deprecated and has
been moved to the keystonemiddleware repo.

Closes-Bug: #1342274

Change-Id: I1aadbe24db63eb2507b088cd53886d7f2e192cab
Avoid name clash between local variable and a module

stack_resource is an imported module and it's been used as
a local variable.

Change-Id: I0988f248f9a80cb893b8a5acded1a8168f5679ac
Use the template module to access the Template class

i.e. stop using parser.Template
this imports the template module as "templatem" to avoid
namespace clashes with the many local variables called "template".

Change-Id: I97cc893f630e46589ee71fc73c6bbbcaa86b3a62
Move neutron_utils functions to neutron client

All uses of neutron_utils functions have been migrated to using
the neutron client plugin version.

Functions in neutron_utils are deprecated and will be deleted in the
next patch.

Change-Id: I1b00485bddffcb6b9dba2ac770668dde9d6a0d70