Trivial: Make vertical white space after license header consistent

Vertical white space between license header and the actual code is not consistent
across files. It looks like majority of the files leaves a single blank line
after license header. So make it consistent except for those exceptional cases
where the actual code starts with a function or class definition.

Change-Id: If6679ab19dc2d7a9df93e076db3019abc1e5b86b
Fix spelling errors in comments

Change-Id: I5ba98f37359ac0b1eaa71de6bf2283508790abf4
Cleanup unused log related code

Not all modules need log function,but there are abused imports
codes for log. Let us clean up them.

Closes-Bug: #1265962
Change-Id: Icd4dc6f9d60cd829e5cd352f00144adb82cf8306
Linked Request IDs

As discussed at the Icehouse Summit, provide a means to
link request IDs across service calls. The linkages
should be marked via logging and notifications.

Implements: blueprint cross-service-request-id
Change-Id: Id085c4444fee2bb68b80738bfe77ccb0ba1908ec
Add error type to unhandled exception log message

Whenever an unhandled exception is thrown, only the exception value is printed
as part of the log message. Printing just the value is sometimes not very
helpful to identify the problem. eg., in case of KeyError, only the 'key_name'
would be printed as part of the log message.
This commit includes the exception type along with value while logging an
unhandled exception.

Change-Id: Ibf00173a07510b2ec0c81a29624004f17810a4e4
Closes-Bug: #1265561
Add common methods to cliutils

Find_resource, service_type, get_service_type, pretty_choice_list,
import_class, import_versioned_module and exit methods used in several
openstack clients, so to prevent code duplication we need port it to
common code.

* Method find_resource used in ceilometerclient, cinderclient, glanceclient,
ironicclient, keystoneclient, novaclient, troveclient and tuskarclient;
* Methods service_type and get_service_type used in cinderclient, novaclient
and troveclient;
* Method pretty_choice_list used in ceilometerclient, cinderclient,
glanceclient, ironicclient, keystoneclient and novaclient;
* Method import_class used in cinderclient, neutronclient and novaclient;
* Method import_versioned_module used in ceilometerclient, glanceclient,
heatclient, ironicclient, marconiclient and tuskarclient;
* Method exit used in ceilometerclient, glanceclient, heatclient,
ironicclient and tuskarclient.

Related to blueprint common-client-library-2

Change-Id: Id9b2f432a73c5cbb9a8a1b26fec3b3a9e6fff94f
Make the log capture in tests more configurable

Use OS_LOG_CAPTURE to turn off log capturing entirely
and OS_DEBUG to control the log level being used.

Change-Id: If8254170087d4f9c312877026ff19a86ac557e53
Add support for locales missing from babel

Babel>=1.0,<1.3 has a bug where some OpenStack supported
locales like 'zh_CN' and 'zh_TW', aren't supported, see:
https://github.com/mitsuhiko/babel/issues/37

In Babel 1.3 they fixed the bug and they support these locales, but
they are still not explicitly "listed" by locale_identifiers(). That's
why we add the locales if necessary so they are listed as supported
otherwise when validating supported locales for the transalated log, we
would fail to allow them even if there are .mo files for
them.

Change-Id: Ie61539a709808dfea690a59602be94347fcfbbb9
Fix mocking of utcnow() for model datetime cols

Now when we are going to deprecate timeutils.set_time_override()
and use mock instead, it easy to hit the following gotcha: when
testr does tests discovering, it imports all modules within a given
directory and it might happen that common.db.sqlalchemy.models
is imported before timeutils.utcnow() is mocked in a test case.
In this case the SQLAlchemy model will save the reference to the
original timeutils.utcnow() function, which will be called later
when the model will be saved to a DB, if created_at or updated_at
value aren't provided.

In order to overcome this we can defer resolution of timeutils.utcnow
reference by passing lambda functions to SA Column __init__().

Related-Bug: #1266962

Change-Id: I7adce90eacb4a3f334d77da7b4a176c31ff818ed
Make Message keep string interpolation args

Update the Message class handling of __mod__() so that arguments
from previous calls are retained. This works around an issue
found in neutron, and likely present in other parts of OpenStack,
where exception classes are performing string interpolation on
Message objects more than one time before emitting the translated
results. See the test comments for an example.

Change-Id: I4c72bb255af7d0a120b702707e11361fedce0f24
Fixes-bug: #1270212
Merge "Make the log capture in tests more configurable"
Fix test method use

Use assertIsNot instead of assertFalse with a separate identity
check.

Change-Id: Id79e0a72aa9946791cbafd9e0f30c962f2c78001
Merge "Make Message keep string interpolation args"
Merge "Fix test method use"
Merge "Fix spelling errors in comments"
Merge "Add common methods to cliutils"
Merge "Add error type to unhandled exception log message"
Merge "Linked Request IDs"
Merge "Cleanup unused log related code"
Merge "Trivial: Make vertical white space after license header consistent"