maint: remove an unused import in libvirt.driver

This import was recently reintroduced, due to
confusing pylint output. Therefore remove it again
and adjust things so pylint won't warn in future.

Change-Id: I25f293f171c651c25d27e8d55c9240fd808590ba
General host aggregates part 2

Partially implements blueprint general-host-aggregates: Scheduler Filter
* Add AggregateInstanceExtraSpecsFilter
* change db.aggregate_get_by_host to return a list of aggregates
  instead of the first aggregate
* Add optional key filter to db.aggregate_get_by_host along with test
* Add db.aggregate_metadata_get_by_host to get host aggregate metadata
* add optional key filter to db.aggregate_metadata_get_by_host
* Add AggregateTypeAffinityFilter

Change-Id: I4a3061276cc3b0c5c695eaf973b773183b3c4f4b
Key block_device_mapping off of volume extension

partially implements blueprint disable-server-extensions

Instead of creating a child controller for boot from volume,
key the post parameter of of the os-volumes extension.

Change-Id: I0dd233c2ae12a09d6fc59c49042c2f8b83f3fdba
Key user_data in create server off of extension

Implements part of blueprint disable-server-extensions

Adds a new extension descriptor for user_data and makes sure that
user_data is only accepted in the create server request if the
extension is enabled.

Change-Id: I7aef0ebe569da841adbf380d5695c9029fb3b002
Key availability_zone in create server off of ext.

Implements part of blueprint disable-server-extensions

Adds a new extension descriptor for availability_zone and makes sure
that availability_zone is only accepted in the create server request
if the extension is enabled.

Change-Id: I326b26c4741ffa6a8b594be26d0cd22d032a6162
Key min_count, max_count, ret_res_id off of ext.

Implements part of blueprint disable-server-extensions

Adds a new extension descriptor callsed os-multiple-create. Modifies
the min_count, max_count, and return_reservation_id parameters to
server create to only be allowed if the extension is enabled.

Change-Id: Iaca009588d6c824e0852a060787d2a4cb9614278
Don't accept scheduler_hints if not enabled

partially implements blueprint disable-server-extensions

moves the filling out of the code behind a conditional to
ensure this data is only passed if the extension is actually
enabled

Change-Id: If866eb87c9e6189b6948cb37f0cb8f5e26c8cced
Make sure ec2 mapping raises proper exceptions

The get commands in the db layer were constructing InstanceNotFound,
VolumeNotFound, and SnapshotNotFound with imporoper kwargs. This
fixes them to raise properly and adds a test to verify that the
exception formatting succeeded.

Fixes bug 1035375

Change-Id: I05a5bb57c047ca2b2f086c70ad12a640f51b2d3a
Don't accept key_name if not enabled

partially implements blueprint disable-server-extensions

moves filling out key_name variable behind conditional only
used when os-keypairs is enabled.

Adds unit tests to ensure this behaves as expected

(Remove debugging that was left in)

Change-Id: I87ce041c2093c93a1a2456ef51357593e9de0681
import module, not type.

This patch fixes a little HACKING issue.  Import the collections module
instead of the defaultdict type from collections.

Change-Id: I59c6fe947b6ed03f13c3481b0484896e8daaa963
Make sure reservations is initialized

In compute API, _delete() could reference reservations before it was
ever assigned, if the call to _update() or to QUOTAS.reserve() raised
an exception--the exception handlers test to see if reservations is
set, and if so, rolls the reservations back.  This patch makes sure
the reservations variable is initialized to None before entering the
try: block.

Change-Id: I7e344074d8fd75b371d78abf8fd15b6f84023cef
Merge "General host aggregates part 2"
Merge "Make sure ec2 mapping raises proper exceptions"
Merge changes I7aef0ebe,I0dd233c2

* changes:
  Key user_data in create server off of extension
  Key block_device_mapping off of volume extension
 Key config_drive off of config-drive extension

partially implements blueprint disable-server-extensions

Change-Id: I42743efeb74b3286c158589eb6af7b1d9ba215d5
Merge "Don't accept scheduler_hints if not enabled"
Merge "maint: remove an unused import in libvirt.driver"
Merge "Make sure reservations is initialized"
Merge "import module, not type."
Merge changes I87ce041c,Iaca00958,I326b26c4

* changes:
  Don't accept key_name if not enabled
  Key min_count, max_count, ret_res_id off of ext.
  Key availability_zone in create server off of ext.