Fix run_tests.sh lockutils when run with -d

Change I007bd39e4d9aad7539b4b7389eb5189b5d1f10e2 fixed how the test
runner was called, but did not take into account that a different
command line is used when -d flag is passed to the script. We fix that but
accounting for the lockuitls change even when -d is passed.

Change-Id: I7462b70a707fff281fabe9d9f20cbb7bf8d037ef
Explicity teardown on error in libguestfs setup()

Previously, in the setup method of the libguestfs driver
for Nova's VFS, on an error the handle object was simply
dereferenced (set to None), and then an new error was thrown.
This relied on an implicit close() on the handle being called
by GC.  However, in some cases the setup progresses far enough
that the implicit close is not enough, and leaves an "orphaned"
libguestfs VM.

Now, the teardown() method is called explicitly, which ensures that
no "orphaned" VMs are left around in case of an error.

Change-Id: I7fbe470046ce6c76bc13d77d8df360351a3ef715
Fixes: bug #1270304
Fixes the Hyper-V VolumeOpsTestCase base class

The VolumeOpsTestCase base class inherits incorrectly from
HyperVAPITestCase, with the unwanted side effect of executing all
base class tests as well.

This patch generalizes a common base class from HyperVAPITestCase
and fixes the inheritance issue.

Closes-Bug: #1280379

Change-Id: Ic81beb8397138c16c8d2d88a9c9d05d2b76e0e83
VMware: add instance detail to detach log message

Provide extra details when detaching a volume from an instance.

Change-Id: I043bce041f82d18379ffc052ad8868ac425167fe
Prevent caller from specifying id during Aggregate.create()

The patch is to remove id when it was set before creating an aggregate
in objects, and check if the aggregate exists before it is created.

Related to blueprint icehouse-objects.

Change-Id: I0d7c5c5da9a93e52c7fee9eee7df80d2f460593e
VMware: support instance objects

Over the course of Icehouse the instance dictionary has been changed
to an instance object. The patch ensures that the driver functions
receive an instance object as input.

Change-Id: I502ab7708f9b3c992ca80d442d794fdd4f5db6d5
Sync latest config file generator from oslo-incubator

The fix to the config file generator to support lazy messages
is the main addition of interest because it is needed before
lazy messages can be enabled in Nova.

Commits included:

  1a6dfb956 Sanitize FQDN in config generator
  e839886cc Config generator fails with lazy messages
  763eedff6 Fix DictOpt support in config sample generator

Note that these commits do not touch any other files (beyond
oslo testcases).

Partially implements blueprint i18n-messages
Closes-Bug: #1280826

Change-Id: I2174139ba3767d05924747cbefa377ba8780103d
xenapi: stop destroy_vdi errors masking real error

We frequently call destroy_vdi in an exception block where we plan to
re-raise the exception.

Should an error occur while destroying the vdi this hides the real error
that caused the problem. To stop this, I have moved those calls to
safe_destroy_vdis and added unit tests to ensure the error from
destroy_vdi does not mask the real issue.

Closes-Bug: #1246276
Change-Id: Ib02f93ab1086f077d3d00e5ca915a26f90552c85
xenapi: changes the debug log formatting

This patch changes the log formatting to use multiple arguments instead
of interpolation.

Note:
It's a matter of performance :
When you do the interpolation in your code, this code will be executed
each time you call the logger (event if the logger or the log level is
not activated).
When you let the logger do the interpolation, it will do the interpolation
only if the logger and log level is activated.

Change-Id: I628000767f41bb0ab1839089a0ba98f6974c4635
Move xenapi/agent.py to new call_xenapi style

At the same time, we used to call get_record to just fetch the domid,
this is very expensive compared to just call get_domid, so I have moved
towards using the cheaper call, particularly because this is called many
times when booting a server.

Part of blueprint xenapi-driver-refactor
Change-Id: If489f41c3d90ba9f738cd56bbc1277d105ab6b8d
Restore get_available_resource method in docker driver

The get_available_resource method, a necessary public
method was marked as private and it snuck through
code review! We caught this with docker-ci, but
only after it was merged.

This patch makes get_available_resource a public
method again, removing the _ prefix.

This is a partial revert for change:
    58d7eeede1e2912ab250fd306c85ca1a05de2fbc

Closes-Bug: 1286457

Change-Id: I07cede8e1ebf606988aeec5bb4d65a9c5ebfe20b
Updated from global requirements

Change-Id: Ice6e0c38c690c85b60641d2006a9f9b1474fa369
Support configuring libvirt watchdog from flavors

The previous watchdog-related patch only enabled the watchdog
configuration to be set from the image metadata.  Now, the watchdog
can be configured from both the flavor extra_specs as well as the
image metadata, with the latter overriding the former.

Implements: blueprint libvirt-watchdog
DocImpact

Change-Id: I626eb8749c1b9a531e49f2471734d903694c5ee8
Merge "Prevent caller from specifying id during Aggregate.create()"
Merge "Explicity teardown on error in libguestfs setup()"
Merge "Support configuring libvirt watchdog from flavors"
Merge "Fix run_tests.sh lockutils when run with -d"
Merge "Updated from global requirements"
Merge "Sync latest config file generator from oslo-incubator"
Refactor xenapi/host.py to new call_xenapi pattern

Update all calls to call_xenapi to the new calling pattern.

This code calls out to the "host" object that this change adding into
the collection of session objects.

An expensive call to host.get_record has been changed to the cheaper
call of get_uuid.

Part of blueprint xenapi-driver-refactor
Change-Id: I4bc4e3f990e36d422beee2a7a9f5fa413044052a