Update latest oslo.setup.

Change-Id: If3d397a1a33e14912abb1f7c94790640fe255d3a
Fix _error_out_instance exception handler

Since Eventlet clears exceptions between greenthread switching, we need
to save that exception so it can be re-raised.

The _error_out_instance event handler did not wrap the quotas call with
the save_and_reraise_exception, so the original exception was lost.

Fixes bug 1163552

Change-Id: I69d28917aae1d787351cd800f8996532e5485eb2
Limit the checks for block device becoming available.

Instead of previously looping potentially forever for a block
device mapping to become created from the volume api, basically
blocking a greenthread until this happens we now will have a number
of attempts (defaulting to 10) that we will wait for the volume api
to create said block device mapping (or error out).

Fixes bug 1162064

Change-Id: I6ff0b42aad48df735d09f91a0a9fe98e6abcf2eb
Explain why the give methods are whitelisted.

In order to aid mine (and likely others) understanding of this
code it seems to make sense to document what these special whitelisted
attributes are.

Change-Id: I1c11484fc74e898df5d25ab94ed0cdb288accd67
Grab instance for migration before updating usage

Updates _update_usage_from_migrations so that it grabs the instance
associated with a migration before updating usage.

Bug 1163622

Change-Id: I64acef912ae71ea5c7fb66e9fcaafe5750c63eaf
Merge "Fix _error_out_instance exception handler"
Merge "Limit the checks for block device becoming available."
Merge "Update latest oslo.setup."
Merge "Explain why the give methods are whitelisted."
Fix a typo in attach_interface error path

This prevents an attach failure from raising the proper exception to
the caller.

Change-Id: I51559cf395fc99738127b7a443437197d15f3d4c
Merge "Grab instance for migration before updating usage"
Merge "Fix a typo in attach_interface error path"
Simplify and correct the bm partition sizes.

The sfdisk code that landed uses -D, which ends up subtracting space
from the first partition - this plays havoc with precisely sized disk
images due to a bug in the automatic adjustment code. Instead we
directly specify the spare space to be allowed.

Additionally, sfdisk can be used much more simply, avoiding any room
for us to make arithmetic errors, and reducing the opportunity for
race conditions with udev so this change does that.

Change-Id: I7f95e867d8775f49698cbbf4b1be40e69db9d538
working copy of openvz driver in nova trunk

Fix logging imports.

adding openvz compatible compute.filters file

Add support for SSH key injection to OpenVZ driver.

code fixes to make openvz driver compatible with nova trunk

nova no longer requires connection.py

remove migration remnants and bring the driver api in sync with ComputeDriver

the new convention is to call a driver a driver and not a connection, renaming connection.py to driver.py

adding openvz driver to the driver.py file for inclusion in known drivers

fixed logger names

renamed openvzconnection to openvzdriver

refactor openvzconnection out of driver code

factor out FLAGS for CONF

fix moved module synchronized

fixed bad synchronized syntax

bulk unit test fixes for openvz unittests

more bulk updates for unittests

more unittest fixes

additional unittest fixes

pep8 fixes

more pep8 fixes

last fixes for test_driver.py

more tests fixed

fixed all unittests and pep8 violations

adding more unittest coverage

Additional test coverage

removing missing VIFDriver

removed db access from driver.py

refactor db access from utils.py

finished factoring out db access from utils.py

fixed broken pip-requires

change the way the openvz driver is presented through nova

fix driver object returned

changed conductor instance from LocalAPI to API

refactor config to pull from oslo

fixed bad import syntax for openvz driver

added some error checking to read_instance_metadata

changed code to handle metadata as it is currently returned from the conductor service

refactor db code in tc.py

change metadata update method to fix broken syntax

moving metadata to a list of dicts

changed metadata to system_metadata

changed metadata to system_metadata with key value pairs

empty metadata seems to appear as a list yet the update type takes a dict so we force the type to be a dict if read metadata is empty

if metadata returned from conductor isn't usable form, raise a type error

use utils.metadata_to_dict to coerce the system_metadata

additional debugging log entries

more metadata fun

more metadata fun

new system_metadata implementation

finish refactor system_metadata

fixed incorrect variable name

refactor system metadata stuff

fixed bad dict iteration in format_system_metadata

change calls to instance_types to use a conductor instance to gather instance_type information from the database

changed old LoopingCall objects to new FixedIntervalLoopingCalls

fixed LoopingCall object missed in previous commit

moved admin context from function call to it's own object to be passed around inside spawn method

first pass at integrating cinder api into volumes

remove call to delete instance from db if it's not found on the host at startup.  this was a bad idea to begin with.

pep8 fixes

more pep8 fixes

fix issue where partially deleted instance is half recreated on init_host()

set instance to deleted if not found on the host

fix instance_update

clean up instance using conductor to prevent deleted instances from being revived by compute manager

removed bulk volume operations in init_host as they shouldn't be necessary anymore

remove bulk volume operations from init_host

adding new local store for volume connection information

reenable some bulk volume operations for init_host to allow reconnection of volumes

fix attach and detach to use instance ref instead of instance name

fix session_currently_connected to handle case where no iscsi sessions exist.

fix broken syntax for reading contents in ext_storage and refactor driver to remove variables named 'file'

catch case where ext_storage file is empty

check the length of contents before trying to load it through json

added a try/except block to handle empty contents

fix save method to allow us to change the ext_storage file for an instance

mount the file systems for containers that are running already so that a container reboot isn't necessary

fix incorrect key name

add utils.py to access the mount and umount commands

change the arguments passed in for mounting filesystems

fix missing split() for mount line execution

fix up uuid so that we can delete the mount points

don't raise on failure of blkid command

only remove openvz related system_metadata as nova wants to find other stuff there

add uuids to instance description to recall uuids quickly to satisfy driver contract

make plug_vifs exit early if the instance is already running

fix instantiation of openvz bulk volume operations

refactor init_host to allow the compute manager to restart the instances

fix reboot syntax

Don't fail on unmount of internal mount. If this was a delete of instance it will already be unmounted

patch up tests to reflect recent changes

fix cfg imports in tests

fix cfg imports in tests

fix get_fs_uuid tests

fix test_stop tests

fix bad openvz driver instantiation

fix removal of db access from utils.py

remove references to instance_metadata_db methods

remove references to instance_metadata_db methods

fixup instance update

fix some virtapi issues

first pass at attaching raw devices

add a _let_disk_settle method to allow the os time to resolve network attached block storage before we try to do things with it

fix the disk settling code to be in the proper place and resolve the broken code that resolves symbolic links

add rootwrap filters

fixed fdisk command and added a short sleep to give the partition table time to resolve

add retry on listing devices as they may not have settled after partitioning

fix conditonal to better identify pertinent lines

change device listing to use globbing and regular expressions

first pass at mknod

add mknod command to compute.filters

fix device name to be the passed in 'mountpoint' which is also called mount_device in the connection_info

code to clean up devices

implement the call to detach devices

remove failure when vzlist returns no instances in memory check

change conditional to check for Container(s) not found

changed conditonal to be based on the existence of stdout

fix new issues with vzlist returning exit code 1 when there are no containers on the system

fix bad privs on device create

fix code path for raw devices to not include instantiation of mount/umount file handles when not using bind mounts

change sleep time from fdisk

soften errors in utils.execute when exceptions aren't important and cleanup fs_uuid stuff in volume.py

changed iscsi.py to be a proper child of OVZVolume

more changes to better follow the object model when using OVZVolume

fixed new order for ovziscsi driver instantiation

refactor to use saved block device names in the container config

fix issue where api will allow a user to create a raw device over an existing one

fix file read where line contains quotes

fix for reboot and resume_state_on_host_boot

change reboot() to use the context passed to it from the compute manager

moved around some volume code to isolate formatted volumes

remove old references to bulk volume operations and removed all code dealing with formatted filesystems to better conform to the nova virt driver contracts

removed ovz_use_raw_devices flayg because it's not needed anymore

removed references to raise_on_error for volume operations as this was part of the kruft needed to support formatted volumes

removed extraneous aruguments from super call in iscsi volume adapter

remove pexpect from pip-requires as we no longer require it

update license info

fixed missing index in _get_vz_device_list

add method to clean out all device entries in the ctid.conf file when the last device is to be removed

worked in some code to handle removing the last ephemeral volume from a container as this is a special case for openvz

fixed special case code that handles removing the last attached device from a vz container

unittest fixes

more unittest fixes

more unittest fixes

more unittest fixes

unittest fixes and remove conductor access from _set_instance_size

more unittest fixes

coerce root_gb to an int before doing math on it as the value comes from the metadata as a string

debug logging

fixed bad formatting character

more debug logging

removed one bad debug logging

more debug logging

fixed issue where vcpus passed into _set_cpus is coerced into an int because comparissons were failing

added a forced coersion in _set_ioprio as memory_mb passed in *could* be a string

changed add/remove devices to only log warning because raising on error causes instances that are being destroyed to raise errors that aren't recoverable

removed more code related to bind mounting filesystems as that codepath isn't needed anymore

fix unittests after removal of _clean_orphaned_directories

pep8 fixes

more pep8 fixes and unittest fixes

removed empty testfile

final unittest fixes