Remove admin auth when getting the list of Neutron API extensions.

Currently _refresh_neutron_extensions_cache() always authenticates
with Neutron using the configured Neutron admin credentials because
it doesn't have access to the calling context.  But it's actually
always called when a valid context exists, and the call to get the
list of extensions is not itself an admin operation.  By passing
the context down we can avoid this additional authentication step.

Change-Id: I9e7d9c5e424a6b39c8f8ee1c79f5fd8f48ad81a2
Closes-Bug: 1250850
Add super call to db Base class

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

Change-Id: Iac6b99d34f00babb8b66fede4977bf75f0ed61d4
Prefix private methods with _ in docker driver

Private methods should be prefixed with a _ for
clarity. Although most private methods were
marked this way, a few were not.

Renames and marks private:
 is_daemon_running
 find_container_by_name
 get_available_resource

Closes-Bug: #1267664

Change-Id: Ifc6818b7620af972cc0eec6f9ef43610456895f1
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
Introduce Guru Meditation Reports into Nova

This commit integrates functionality from the
`openstack.common.report` module into Nova.
This enables Nova services to receive SIGUSR1
and print a Guru Meditation Report to stderr.
The required modules were added to
'openstack-common.conf' as well.

Change-Id: I224a426dad084f0e738069207ffbffe7f7935a17
Implements: blueprint guru-meditation-report
VMware: fix datastore selection when token is returned

Use the token returned by the PropertyCollector to iterate
over the complete set of datastores and select the best
match based on the regular expression and the free space on
the datastore.

Closes-Bug: #1245564
Change-Id: If24c37a41bfa994a990aaa4a3e21d16b33aad42f
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
Add pack_action_start/finish helper to InstanceAction object

Add these two helper function to cut InstanceAction object's dependency
on compute/utils.py. This is a refactor change so that
pack_action_start/finish code in compute/utils.py can be removed in a
later change.

The version of InstanceAction object doesn't change, since it's just an
object internal refactoring. No object field or method has been changed.

This is a part of: blueprint make-instance-action-use-objects

Change-Id: I38bde7b057efa0ce5634941f4ffa5ef27123958c
Re-Sync oslo-incubator fixtures

Syncing to add fixture.logging
(I7a4ab4f181634ed5b92ce88e9ed1d976ecb633a7) which will be enabled for
unit tests in a subsequent patch.

Commits Include:
 782fc83 Fixture to reraise exceptions raised during logging
 c178e56 Add basic Python 3 tests
 f6a97ac Enhance config fixture to support registering options
 b9d2ee4 Cleanup config fixture docstrings
 b8a191b Add 'new' parameter to mock.Patch and mock.PatchObject classes
 45658e2 Fix violations of H302:import only modules
 6fa29ae Trivial: Make vertical white space after license header
 consistent
 12bcdb7 Remove vim header
 3970d46 Fix typos in oslo
 371fa42 Move LockFixture into a fixtures module

Change-Id: I87e9e51610f3d00e92755c4f40aa295e60e440fb
Use oslo-common's logging fixture

Make the unit tests raise an exception when there is a logging
formatting issue. Related to oslo BP
logging-handleerror-raise-exception

Change-Id: Id4aa4277c387f1b67db4209d467c570b3c630f29
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
Make baremetal driver use Flavor object instead of VirtAPI

This makes the baremetal driver use the Flavor object instead of
getting that information through the VirtAPI/conductor call.

Related to blueprint compute-manager-objects

Change-Id: I1cbc3fc77bbbcaa3c194f12814893c5937fb6e96
Make compute manager use Flavor object

This makes compute manager use the Flavor objects instead of a
raw conductor API to get information about flavors during resize.

Related to blueprint compute-manager-objects

Change-Id: Ieb56b754eb5a4824fc69093897bdff25ab020883
Make resource_tracker use Flavor object

This makes the resource_tracker use the Flavor object for getting
information about an instance's flavor instead of a raw call to
conductor.

Related to blueprint compute-manager-objects

Change-Id: Ida93eeed9b8f8f5da267cff6a6b38f6661479b36