Middlelware to ensure request ID

The feature of the proposed middleware is simple:
* Generate request-id for each REST request
* Set the generated request-id to request environment
* Add X-OpenStack-Request-Id header to API response to return request-id

blueprint middleware-request-id

Note that to use this middleware with Context, we need to change
auth middlware so that request-id will be retreived from request env.

Change-Id: Ic7967cd62e7b743343d70f751b9238339171e013
Translation Message improvements

The improvements to the current Message implementation include:

* Implementing a new method translate() to explicitely perform the
translation of a Message object, instead of relying on setting the
'locale' property.
* All of the codebase assumes _() is a unicode object, so make the
Message unicode, that will always behave as unicode, except for the fact
that it has the extra ability to translate() on demand.
* Remove the internal representation of the translated Message (i.e. the
data property) and rely on parent implementations.
* Enhancement to the corresponding TestTranslation class to enable fake
translations for multiple locales.

With this patch the REST API translation in the other projects will work
with very minimal or no impact after re-enabling the 'lazy' _().

Partially implements: bp i18n-messages
Change-Id: I2dbddf422e79fd4474dede1e7c7ed229c89dc30c
Allow configurable ProcessLauncher liveness check

The current interval between ProcessLauncher checks of whether
a child process has exited - 0.01s - prioritizes fast respawning of
children at the expense of cpu usage.  This tradeoff may not be
appropriate for all clients of the class, so this patch makes the
interval configurable.  The current interval remains the default
to avoid changing expected behavior.

This patch was motivated by unnecessary idle cpu usage of the
Neutron service when configured to use ProcessLauncher-managed
worker processes.

Partial-Bug: #1095346

Change-Id: I2f5e06f98be1f75c21e6681967b573f5d88a4ed6
Fix filter() usage due to python 3 compability

Built-in method filter() returns a list in Python 2.x [1], but it
returns an iterator in Python 3.x [2]. To remove the difference (and
make code more readable, also), we use list comprehension instead of filer().

[1] http://docs.python.org/2/library/functions.html#filter
[2] http://docs.python.org/3/library/functions.html#filter

Related to blueprint make-python3-compatible

Change-Id: Ifd42403309ba3a44693e0c7c856a64b861eca3e9
Add check_uptodate to tools/config

Add a script which can be used to validate a project's
sample config and ensure that it remains up to date on every commit.

Change-Id: Iee6cc05cad70963f2a151f595ac376c9338f5774
Adjust imports order of module log_handler

According to http://docs.openstack.org/developer/hacking/#imports,
adjust the imports order for module log_handler.

Change-Id: Ic0661e31cf810c2686016c015f6268918635ed99
Merge "Add check_uptodate to tools/config"
Merge "Adjust imports order of module log_handler"
Fix database connection string is secret

The database connection string was not marked as secret, so it
would be printed out in cleartext in the logs when config settings
were logged.

The database connection string typically contains the password
that's used to connect to the database, so it should be marked as
secret so that it doesn't get logged.

Change-Id: If6e1026814262c961a4f22d90f546cec34831bc8
Closes-Bug: #1266590
Merge "Translation Message improvements"
Implementation of translation log handler

This patch implements the TranslationHandler which is a LogHandler that
enables translation of the log records before they are logged.

The handler is configured declaratively in the logging.conf as follows:

        [handlers]
        keys = translatedlog, translator

        [handler_translatedlog]
        class = handlers.WatchedFileHandler
        args = ('/var/log/api-localized.log',)
        formatter = context

        [handler_translator]
        class = openstack.common.log.TranslationHandler
        target = translatedlog
        args = ('zh_CN',)

A prototype version included with the initial version of the Message
class is removed.

Change-Id: I77b6b8a6f5b6360a9bb67ec56cdc927fe91597be
Allow the Message class to have non-English default locales

This patch does an initial translation of the msgid (which is in
English) when the Message class is created, just in case the system's
default locale is not English.

Change-Id: I24b3779f55c8a57849f42c72f4104f2aa22640eb
Merge "Allow configurable ProcessLauncher liveness check"
Merge "Middlelware to ensure request ID"
Merge "Fix database connection string is secret"
Merge "Fix filter() usage due to python 3 compability"
Merge "Implementation of translation log handler"
Merge "Allow the Message class to have non-English default locales"