Add missing unit tests for VMwareAPISession

This change adds unit tests for the following methods:
* pbm property
* _get_session_cookie
* invoke_api with stale session

It also updates one test for _create_session.

Change-Id: I4ab519a498f844e9c8b2889f84721935dfed1a5b
Add unittest method "test_download_flat_image"

Currently, there is not a test method of download_flat_image.

Change-Id: I8ed68222b3ef195464901d8c6442cc397ffdb272
Merge "Add missing unit tests for VMwareAPISession"
VMware: treat cases when SOAP reply does not have a body

There are cases when the SOAP reply does not return a body (for
example UnregisterVM may return this when running the CI).

This patch ensures that an exception is not thrown.

Change-Id: I394320641c648effd1209345cfd729e975f12aab
Closes-bug: #1300788
Fix vim25:InvalidRequest when no profiles exist

Currently, we don't check if there are any existing profiles in
pbm.get_all_profiles. As a result, we send a malformed request to
PBMRetrieveContent resulting in vim25:InvalidRequest.

Change-Id: I882c97a8050f8c2d49a4ce1de0f166e457ce68f2
Closes-Bug: #1302271
import run_cross_tests.sh from incubator

Change-Id: I1ba7f5e0879e71f456772d7b762c69bb0967fe18
Merge "Fix vim25:InvalidRequest when no profiles exist"
Add a test to oslo.vmware test_image_transfer

This change adds unit tests of the following methods:
    * _start_transfer
    * download_stream_optimized_data
    * download_stream_optimized_image
    * upload_image

Change-Id: I2c99231f873b9bbe0d2d806966d7e69b10c80675
Remove __del__ usage in oslo.vmware driver

The driver uses __del__ in which may cause spurious errors.
python docs detail the caveats of using __del__.

In order to enable the calling application to be able to close
existing sessions, a new method has been added: logout.
This will be used to terminate and logout of the existing session.

Change-Id: I94482b79cc451d027cb853a6d0775e4da189cb7e
Updated from global requirements

Change-Id: Ica7572524227411f0d496d9b74d39396634e9200
Sync changes from Nova error_util.py

Picking up bits and pieces from the following changes to error_util.py

563f719 VMware: add missing translations
62cb0dc VMware: Log additional details of suds faults
91ddf85 VMware: Fixes the instance resize problem
38fc557 VMware: add missing translations
1c6898e VMware: VimException __str__ attempts to concatenate string to list
dd4032e Enable flake8 H404 checking

Change-Id: I7a5d9400392d473b0e35a814f29dca47c5e56568
Updated from global requirements

Change-Id: I24bc7344e6828533de74a2a3f7c808888485c32d
Don't translate debug level logs in oslo-vmware

Our translation policy
(https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation) calls
for not translating debug level logs. This is to help prioritize log
translation. Furthermore translation has a performance overhead, even if
the log isn't used (since nova doesn't support lazy translation yet).

Change-Id: I54e8ade29015e11b3383920cd6b1f45ad6c81324
Merge "Add a test to oslo.vmware test_image_transfer"
Merge "Don't translate debug level logs in oslo-vmware"
Support 'InvalidPowerState' exception

The aforementioned exception is used to determine if a VM is
already powered on. This was introduced in the spwan refactor:
https://review.openstack.org/#/c/83207/.

Change-Id: I35fa88cdae5d488d0dbf65346aa5903e5eec17fb