Python3: do not use contextlib.nested()

Use the "mock.patch.object" decorators instead: they are compatible with Python
2.6, 2.7 and 3.3.

Change-Id: Iba053caef0d8095f8df74fbf9a59059093bc06e8
Blueprint: make-python3-compatible
Python3: enable test_jsonutils.py

Change-Id: I22f5d92c4c0034162b6fc27b785bd034d4d25f86
Blueprint: make-python3-compatible
Remove redundant test cases in test_imageutils

The applied testscenarios test cases covers the original tests exept
for the case where all values are None.

Change-Id: Ie926b5e8cc24a597c281f51d33cc50b911e86305
save_and_reraise_exception: make logging respect the reraise parameter

Do not log original exception if reraise is set to False

Closes-Bug: #1291850
Related-Bug: #1288188

Change-Id: Icd5fcba25c2cd549cee70353a7a62d83bfe1255b
Return the thread created in consume_in_thread

Returns the thread created so that the caller can manage it.

Change-Id: If9685a8ddc95b5db179ff8a10ec0ca5fd62ffbed
Closes-Bug: #1293650
Dispose db connections pool on disconnect

When a disconnect happens (e.g. when VIP moves to another node), all
existing connections in the pool become invalid. There is no sense to
check every single connection in the pool, as this may take a long
time (e.g. when python-mysqldb driver is used with eventlet green
threads, there is no context switch on db IO, so the whole process is
blocked until socket read times out). Dispose all connections in the
pool when disconnect is detected, they will be recreated on demand
then.

Closes-Bug: #1288438

Change-Id: Ia357da2b3092d306a86b6d1787bab374a335f28c
Merge "Return the thread created in consume_in_thread"
Merge "Dispose db connections pool on disconnect"
Merge "Remove redundant test cases in test_imageutils"
Merge "Python3: do not use contextlib.nested()"
Merge "Python3: enable test_jsonutils.py"
Merge "save_and_reraise_exception: make logging respect the reraise parameter"