xenapi: Fix console rotate script

First time run of the console rotate script failed, due to the fact that
the logs did not exist at that time.

Fixes bug 1204440

Change-Id: I49b5569c1ba3349d911caace42685fa0f19a1f66
Don't pass empty image to filter on live migration

If live migration for a volume backed instance without an image supplied
is initiated with no destination supplied, glance client show will not
be called and the image variable will be set to None.

However if passed to filters like that as part of the request_spec
dictionary, None value will cause one of the default filters - the
ImagePropertiesFilter to throw an exception in it's host_passes method,
as it expects an image to be a dictionary.

We solve this by leaving out the image entirely before engaging filters,
and not attempting to get it if it was not supplied to the instance.

This bug was previously fixed (however not fully, as the None image
would still cause an exception) in the following patch:
Ie683a3ca5d6430c52ead77b41f98fbcb4114ea1e, but  was accidentally dropped
in I6de33ada6dc377e20f8df07da92244f2c150b9fe.

Fixes bug 1170596 (again)
Fixes bug 1199811

Change-Id: I0239b6ac5640d075f937f9690eca4ce54f534117
Add latest oslo DB support

The common oslo code is backward compatible.

The database configuration variables are now in a new section
[database].

DocImpact

Change-Id: I978493f692179ecf09ea9ed98d521b3e65394880
Ensure that uuid is returned with mocked instance

Fixes bug 1204798

Change-Id: Icf8f1f63be4b7492ef3f788836db2c0d23477567
Servers API for the new BDM format

This patch makes the nova API aware and able to accept the new block
device mapping format introduced in
If30afdb59d4c4268b97d3d10270df2cc729a0c4c when booting an instance.

It does so by introducing a new extension into the v2 API. There is no
v3 extension as part of this patch because volume extension is going
away in v3 and thus this functionality can be part of the core servers
extension. This will be done in a subsequent patch.

The compute API create method will still convert these back to the
legacy format for the time being until the compute API will know how to
take advantage of the new format.

As this change adds the new API extension, marking it as DocImpact so
that the changes and the API data format can be documented.

blueprint: improve-block-device-handling
Change-Id: I2c1b63e41deca26f727fb9ed912a55494db9c76c
Add basic BDM format validation in the API layer

Adds the basic sanity checking for the new BDM data format when it's
passed in to the servers create method. Also make block_device routines
that raise IvalidBDMFormat error add a brief explanation to it that can
be reused to send more informative validation errors to the user.

More comprehensive validation that will take a look at the request as a
whole, and take into consideration all the metadata, will be done in
the compute API create method in the subsequent patches.

blueprint: improve-block-device-handling
Change-Id: Ie4c2c9a219be91faa07106f820a728ca9ac42e1b
Bypass queries which cause a contradiction

This addresses the cause of the log lines like:

SAWarning: The IN-predicate on "instance_system_metadata.instance_uuid"
was invoked with an empty sequence. This results in a contradiction,
which nonetheless can be expensive to evaluate. Consider alternative
strategies for improved performance.

for instance_metadata, instance_system_metadata, and instance_faults.

It especially helps the case of a call to /servers/detail when there are
no servers to list because each of those tables is scanned despite a
guarantee that there will be now rows.

Bug 1204916

Change-Id: I62e65c4409d3e3ab8373eb66450414565c222547
Fix postgresql failures related to Data type to API-v3 fixed-ip

Postgresql is kind of sensitive about different kind of data in a query, so it
was failing in cases like looking for an ip using a filter which wasn't a valid
ip or ids values greater than the id type on the table.

This patch fix this behavior to fixed ips in API-v3.
In v2 this was fixed by change I83d532c28c9aec690e8e1ffad8b58e71d619d728

Fixes bug 1182754
Fixes bug 1204503

Change-Id: I9aa14bea2f29f1df85dfd1f07eb0b1947d2c1100
Set lock_path in tests

When lock_path is not set, the synchronized decorator doesn't work
properly.  This change is required so that synchronized can throw
an exception when that happens instead of failing silently.

Change-Id: I341a522e59fda3feb8e41379d06ad3c8f97e5597
Remove the monkey patching of _ into the builtins

Previous _ was monkey patched into builtins whenever
certain modules were imported. This removes that and
simply imports it when it is needed.

Change-Id: I0af2c6d8a230e94440d655d13cab9107ac20d13c
Merge "Ensure that uuid is returned with mocked instance"
Merge "Servers API for the new BDM format"
Merge "Remove the monkey patching of _ into the builtins"
Merge "xenapi: Fix console rotate script"
Merge "Add basic BDM format validation in the API layer"
Merge "Add latest oslo DB support"
Merge "Don't pass empty image to filter on live migration"
Merge "Bypass queries which cause a contradiction"
Merge "Set lock_path in tests"
Merge "Fix postgresql failures related to Data type to API-v3 fixed-ip"