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
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
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: make session calls more discoverable

Its currently hard to discover what existing calls there are to
XenAPI, and the *_utils.py are getting very large.

Also, with the move to mock, it is becoming hard work testing multiple
calls to call_xenapi within a single method. Moving to this more object
oriented way of calling XenAPI should make writing tests with mock much
easier, and give us an obvious place to move some of simpler helper
methods in vm_utils and volume_utils.

This is the very first step in this direction. Dependent patches will
show how this can be used.

Part of blueprint xenapi-driver-refactor
Change-Id: I021fbedf2e84d58f24a3d9cb8fab0b906125f7c1
Refactor pool.py to remove calls to call_xenapi

In addition adding the Pool XenAPI object that is needed by pool.py

Change-Id: I1b417c469bbb2542a3fde40064142bde2b4dd400
When a claim is rejected, explain why

Previously, the Claim class offered #test which would return a Boolean
based on availability of memory, disk, CPU and PCI devices.

Now these tests are performed from the constructor and if any test
fails, an exception is thrown. All failure reasons are described in the
exception message. EG:

  "Insufficient compute resources: Free memory 8192.00 MB <
  requested 16384 MB; Free disk 45.00 GB < requested 50 GB; Free CPUs
  16.00 VCPUs < requested 17 VCPUs."

Change-Id: I5bf9c81bba747a6c164144e60a92dc6da2f98f4c
Closes-Bug: #1212768
Adds get_console_connect_info API

Implements: blueprint hyper-v-rdp-console

Currently graphical console access to Nova instances is limited to
clients which are part of Nova itself (novnc, xvpvnc, spice-html5).
The mentioned clients verify the validity of a console access token
with the following private API:
nova.consoleauth.rpcapi.ConsoleAuthAPI.check_token

The usage of a private API precludes the possibility of employing
external graphical console clients, including FreeRDP-WebConnect, used
to connect to Hyper-V instances via RDP.

This change adds a public API method that wraps the aforementioned
check_token private API. This allows external clients to obtain the
necessary protocol connection information by providing a token
previously obtained with calls to get_vnc_console, get_spice_console
or get_rdp_console.

Includes V2 and V3 API implementations.

Change-Id: Idd1e4f57b16bd1488f3b72bb064cef51321a7c79
Sync latest Guru Meditation Reports from Oslo

Nova fails to start on Windows due to non portable signal handling
(SIGUSR1) employed in this patch.

This patch enables the reporting feature only if signal is available
on the current platform.

Oslo commit: d3a285e33fa936cec5d14dfefa20dc03cc90ac18

Closes-Bug: #1286528

Change-Id: I070ab57b18b2bc43df5ec84c51ccb86be1ff0d2a
Updated from global requirements

Change-Id: Ice6e0c38c690c85b60641d2006a9f9b1474fa369
Merge "xenapi: make session calls more discoverable"
Merge "Refactor pool.py to remove calls to call_xenapi"
Merge "When a claim is rejected, explain why"
Add watchdog device support to libvirt driver

This commit adds support for watchdog devices
to the libvirt driver.  The watchdog device
used is 'i6300esb', and the action is based
or the 'hw_watchdog_action' property of the image.

Implements: blueprint libvirt-watchdog
DocImpact

Change-Id: Icf1f51d7929e40d0caeae569bd2b6eee8be9689e
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 "Sync latest Guru Meditation Reports from Oslo"
Merge "Adds get_console_connect_info API"
Merge "Add watchdog device support to libvirt driver"
Merge "Prevent caller from specifying id during Aggregate.create()"
Merge "Explicity teardown on error in libguestfs setup()"