Fix i18n support for apiclient

There are some messages in apiclient which don't support i18n,
this patch must fixed them.

Change-Id: I9247d3d765da7242b4df29b0a7b1f7ff6eee0cdd
Closes-Bug: #1275665
Ensure options passed to update.py are sane

Some of the example commands in the update.py docstring seem like
they should work but don't because of the way we parse the
positional argument.  This means that specifying a list of modules
and a positional target directory doesn't work, because the module
list ends up being overwritten by whatever is in the target
directory openstack-common.conf.

This change checks for that situation and does the right thing.  It
also detects when a config file and a list of modules was explicitly
passed to the script, which will not work as expected due to the
behavior above.

Change-Id: Ib04401a1e8bba20fdee92cbca69ba6d1ba689c24
Let update.py read/write same file one time for all replacements

update.py handles base name replacement after copying each file.
We read/write same file for each replacement, we'd better collect
all replacements and read/write file only one time for all replacements.

Change-Id: Ifa274b6f4426fa0e65e5a3d6fd40dfde3aff1bd2
Closes-Bug: #1304788
generator: sanitize values ending with the fqdn

Some options (neutron_id in the neutron bigswitch plugin) use the
hostname/fqdn to generate default values prefixed with a static string.
This patch handles such options and sanitize the default value by
replacing the hostname/fqdn with the 'oslo' string.

Closes-Bug: #1298589
Change-Id: I2471d638f42fc425efc928b280e1b47c23fddabd
apiclient.exceptions.from_response() may miss request_id

The common header name for the request ID value across OpenStack projects is
x-openstack-request-id. However, apiclient.exceptions.from_response() checks
for x-compute-request-id, which is only set in nova and cinder responses.
This precludes the request ID value from being outputted by glanceclient and
others; this hinders error debugging.

Change-Id: Ibb88d5e6a22c7422315dffd7c5853a29864e34d9
Closes-Bug: #1306654
Warn the user when they sync an obsolete module

Print a warning from update.py when the user syncs an obsolete module,
including a message about which new oslo library they should be using
instead.

Change-Id: Id65ab87ef6a89a772a4fab838220454c394a8737
sizelimit: port to Python 3

In the tests, use bytes for the request body, since that is what is used by
webob in Python 3.

In RequestBodySizeLimiter.__call__(), do not compare NoneType to an integer: it
is forbidden in Python 3. Instead, properly handle the fact that
req.content_lenght might be None.

Change-Id: I179997789b9e2fcd3f3326e4d724e547c807f195
Move notification point to a better place

Follow-up for I80f325c9be9c171c2dc8d5526570bf64f0f87c78
"notify calling process we are ready to serve"

Xavier Queralt found issue with sending readiness notification from inside
run_service: it returns premature OK in case of multiple service endpoints
in one systemd service like nova-api which by default provides osapi, ec2 and
metadata services.

Instead, send readiness notification before entering wait loop for each
Launcher type.

Change-Id: I69bf10f353f5fecaaf89e537c2d3c46b73e39d36
Implements: blueprint service-readiness
Remove duplicated "caught" message

The affected messge is duplicated in _wait_for_exit_or_signal.  Since
INFO doesn't log it's source function it can be confusing as to where
this log output actually came from.

See also https://review.openstack.org/#/c/85639/

Change-Id: Ic4ff6321559cd484b722955c70d0db776e3e6620
Merge "sizelimit: port to Python 3"
Merge "Move notification point to a better place"
Use oslotest instead of common test module

Module openstack.common.test is obsolete, so we should use
oslotest library instead of it.
Modified tests and common database code, new requirement added.

Change-Id: I853e548f11a4c3785eaf75124510a6d789536634
Drop dependency oslo.db from common.log

Openstack common.log module registers a few oslo.config options,
which possibly could cause of DuplicateOptError raising in case of use
of both common.log and oslo.db in target projects.
Thus logging module from python standart library should be used.

Change-Id: I1ab30ab99ec2564687ee166aa93aab32268e4c1d
Blueprint: oslo-db-lib
Fix tests.unit.reports.test_views failures under Python3

Had to activate PYTHONHASHSEED=0 in tox.ini to avoid randomization of
the dicts.

Change-Id: Ie19f27e19d570803a51d6ae3522683bc79fbf9a8
Use from/import style in module report

Files in module report are using 'import openstack.common.*', not 'from
openstack.common import'. Though these two ways work well. But the first
one let update.py can't replace with base_name, see
https://github.com/openstack/oslo-incubator/blob/master/update.py#L163
Considering other modules are using oslo-incubator code in the second way,
to keep consistency, we'd better follow the last one.

Closes-Bug: #1304774

Change-Id: Ife98dc96b012d6aa7b5bd10d09a733506072fa1c
Allow passing environment variables to execute()

Some of the projects might need to pass environment variables
to the processes they launch. For instance, if something needs
to rely on the process' output it should be able to pass LANG="C"
in order to set the correct localization.

This patch adds a env_variables parameter to processutils.execute()
which allows to pass news variables or replace the value of the existing
ones for the process.

Closes-bug: #1304284
Change-Id: If801e11391bf7cf66518533443c3b29af53653e5
Merge "Fix tests.unit.reports.test_views failures under Python3"
Activate unit tests from test_base_report.py under Python3

Change-Id: I780cb2be94e7be7ec3ca4eccacad429af5bb748a
Fix tests.unit.reports.test_guru_meditation_report under Python3

Change-Id: Ib329965aecc5e685eed9c1d313ffe1b709981b71
Merge "Use oslotest instead of common test module"