Add super call to db Base class

Without this call, multiple inheritance involving the db Base
class does not work correctly.

Change-Id: Iac6b99d34f00babb8b66fede4977bf75f0ed61d4
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
Fix upper bound checking for flavor create parameters

Fix flavor-create upper bound checking so it uses platform-independent
32-bit max signed integer value instead of sys.maxint, which causes
problems on 64-bit platforms.  The DB int type is a 32-bit signed
integer, regardless of platform.

Change-Id: I82624121a45f6385d3ea9ae9c032109834584fac
Closes-bug: 1278939
Add mkfs to the baremetal-deploy-helper rootwrap

The nova-baremetal-deploy-helper uses the mkfs command to
format the ephemeral partition (if configured). The
command works today because it is also defined in the
compute.filters file but we should be explicit here.

Change-Id: I79c31ffd26ff92d35d3d9836f2a8954a9a07c2c0
Add comment/doc about utils.mkfs in rootwrap

We call mkfs in nova/utils.py as well. Updates
the rootwrap file so we document this.

Change-Id: I58a3f4686735f45ee1aafe698f6662ff9d70e1f1
Ensure parent dir exists while injecting files

Currently, if we inject a file to a not existing path,
the injecting will be failed with error 'No such file
or directory'.
Nova will firstly execute `mkdir -p` in folsom before injecting,
but this operation is lost from commit
72918415f2b6a241d6097a563aba55a849936591

This patch fix this bug by adding the `mkdir -p` operation as folsom.

Closes-bug: #1272829

Change-Id: If33a79c538e07cb25300db64ac7a9dee3d3b19c2
Add boolean convertor to "create multiple servers" API

"create multiple servers" API contains "return_reservation_id" as an
attribute, and the attribute should be boolean. There are the other
boolean attributes such as "on_shared_storage" of evacuate API, they
can be passed with either boolean or string(e.g. "True"). For the
consistency of whole Nova APIs, this patch adds boolean convertors to
multiple_create API.

Change-Id: Id6f458a2ced869a31d5d25d661309973132e9360
Closes-Bug: #1281440
Adds create backup server extension for the V3 API

Moves create_backup functionality out of admin_actions
into its own extension. This is part of blueprint v3-admin-actions-split
which allows more selective enablement of features contained
in the admin actions extension.

Note that XML api samples are no longer generated because bp
remove-v3-xml-api has been approved.

Partially implements bp v3-api-admin-actions-split
DocImpact: Adds os-create-backup extension and moves the
create_backup functionality out of os-admin-actions into
this new extension.

Change-Id: I4858a06df20c552bd55ff2841adbcfc761304f42
Removing redundant validation for rebuild request.

Any method decorated with wsgi.action will need to have
the said key, in this case 'rebuild', before it
reaches the relevant code block. If not, a key
error is raised when the wsgi.action code kicks in. This
code is at openstack/wsgi.py in the  _process_stack
method and subsequently the self.get_method method.
A KeyError is raised and caught. Removing the redundant
check for rebuild api.

Change-Id: I4baf920c7e1b3d51a91323f12d0802cedec77fe2
Downgrade the log level for floating IP associate

When a deallocating for an instance, it might find a floating
ip is already disassocated, this patch downgrade the loglevel
from exception to info and add floating ip address into the log.

Change-Id: I119c78270c2b24937484329e8fbaaa22546ea021
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
Remove and recreate interface if already exists

If a nova-compute machine restarts when openvswitch comes up it logs the
following warning messages for all tap interfaces that do not exist:

bridge|WARN|could not open network device tap2cf7dbad-9d (No such device)

Once the compute-node starts it recreates the interfaces and re-adds them
to the ovs-bridge. Unfortunately, ovs does not reinitialize the interfaces
as they are already in ovsdb and does not assign them a ofport number.

This situation corrects itself though the next time a port is added to the
ovs-bridge which is why no one has probably noticed this issue till now.

In order to correct this we should first remove interface that exist and
then readd them.

Change-Id: I1dc01604c5857941d9f35eb1e0c4d5103a56d57b
Closes-bug: #1270973
Related-bug: #1268762
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
xenapi plugins: Make sure subprocesses finish executing

Fixes bug 1286187

Neither execute_get_output() nor execute() would wait for the process to
fully finish executing. This could potentially create a race condition
where commands execute in a different order than intended.

Also, for execute() it could cause a process to never finish executing if
it generates enough output to block writing to the pipe.

Change-Id: I3404f4b3ca1cddeec2f3e7b393817a6ccc42bec7
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
Remove deleted module flakes from openstack-common.conf

flakes: Id2e882837bdde51a60562e8cdd207c7ff0c88a6a

Change-Id: I238e4e5c103dc0475001db80ef6ee8885913a211
Remove log_handler module from oslo-incubator sync

log_handler is now part of
oslo.messaging(I9ea051ec7e3614579341a31d8dc1c13d9514b8a9).

Change-Id: Ic3493b8717c83285e6aafeae23a29d2794a9b2a9