Add expected_errors for extension console_output v3

Partially implements bp v3-api-extension-versioning

Change-Id: Ibb25c3e853f83c2dae35a5ba34e193a639b53ab1
Add expected_errors for extension keypair and availablity_zone

Partially implements bp v3-api-extension-versioning

Change-Id: Icb13630d5e4b8806ab95ccf464c9d80e9a9f160b
Fix some Instance object class usage errors

This fixes a few places where Instance methods call
directly to Instance._from_db_object() instead of
using 'self' or 'cls' so that they can properly be
subclassed.

Related to blueprint compute-api-objects

Change-Id: I8e47901bd387048211d186f180991e8f780883c4
powervm: pass on unimplemented aggregate operations

The powervm driver does not implement the add/remove/undo aggregate
operations defined in the base ComputeDriver class which can cause
issues when running Tempest with the powervm driver. This patch simply
overrides the methods in the powervm driver and does a pass like in the
libvirt driver.

Fixes bug 1206528

Change-Id: Ieac227f321339a4069b015303b6e713ab9fad7b7
Fix and Gate on H303 (no wildcard imports)

Wildcard imports make reading code unnecessarily confusing because they
make it harder to see where a functions comes from.  We had two types of
wildcard imports in the code. Unneeded ones in test files that are just
removed, and some that we actually want which are kept using the '#
noqa' comment to tell flake8 to skip specific checks (such as H303)
for that line.

Change-Id: Id4705011579659fd74a4aaa05ac541e9694c483e
Sync config.generator from Oslo

Includes:
7448e7e Fix hostname conflict in config generator

Fixes bug 1205411

Change-Id: I13988ef73db05bbdab355400c19e1ad136b59fc0
Add expected_errors for extensions quota_sets and hypervisors

Partially implements bp v3-api-extension-versioning

Change-Id: Ic9b2bebc5974a47beebee6bd6eba192ee0ede74b
Cleanup copy/paste in test_quota_sets

Tests in test_quota_sets extensively use quota_set data that's
copy/pasted everywhere, so introduce a method that generates this
quota_set data and make use of it in the tests.

blueprint nova-tests-code-duplication

Change-Id: Icac3e4b5f48592c63a8376c84a744f3dac0cec36
Refactor EC2 API error handling code

Implements blueprint ec2-error-codes

Redundant logging code was united in new __init__.py:ec2_error_ex() helper
function and all standard EC2 error responses are now uniformly logged on
DEBUG log level because they are just responses to invalid client requests,
not nova errors.  Unexpected client/server errors are logged on ERROR/CRITICAL
level and their exception name is used as error code - no more useless
UnknownError. Error descriptions are supressed for unexpected server errors as
they might contain sensitive information. New unit tests are provided.

The code for consturcting EC2 error response which was duplicated in
__init__.py:ec2_error and faults.py:Fault was moved to
faults.py:ec2_error_response.

__init__.py:exception_to_ec2code helper function now always returns exception
name as an EC2 error code since there are no exceptions with ec2_code
attribute yet. These will be added in the follwing patch as required by
referenced blueprint.

This code cleanup serves as a base for future fix of current terrible EC2
error behavior.

Change-Id: Ie88b089dfe536a56f5a46e9c92ff90c6a1fef793
Refactor compute API's delete to properly do local soft_deletes

Right now, if you try to soft_delete something that is on a downed
host, the _local_delete code will actually hard-delete it, which
isn't what you would expect. The compute init code already handles
the case of soft-deleted instances while it was down, so we just
need to alter the frontend behavior.

Note that tests for this are added in the next patch, which was
written first and because there would be a ton of conflicts
generated by inserting them here.

Change-Id: I09f33bbcd7799b2bc1289b6100b291a7e6b26d9c
Make delete/soft_delete use objects

This makes the delete and soft_delete paths use objects.

Related to blueprint compute-api-objects

Change-Id: I74bf4ad99e28d4c349c2f739d8d515e432913194
Fix multi availability zone issue part 1

Current aggregate APIs allow user to add multi
AZs to a host, but Openstack support single AZ
of a host. When booting an instance, nova uses
the first AZ assigned to a host,even if user
assigned multi AZs to the host and user chose
the second AZ to boot an instance. So multi AZs
aren't supported by current Openstack design,
we should fix aggregate APIs to align the design
. This patch is for limit user to add multi AZs
using aggregate-add-host API.

The part 2 limits user to add multi AZs using aggregate
update and aggregate metadata update API, here is the
link:
I18ad1ac22c6aee298ccc75c978b85241ae1ac616

Fixes: bug #1196893

Change-Id: I788782a9f21ec2672551f75123753175bb268586
Code dedup in class QuotaReserveSqlAlchemyTestCase

Moved common parts to setUp()
   -quotas
   -deltas
   -usages
Move reservations update and usages init to separate functions

bp nova-tests-code-duplication

Change-Id: I03efed0d1f40ba7670c919efed4fdafaf59576f8
xenapi: Rename imageupload image

The imageupload driver concept has helped detangle some of the image managment
code in vm_utils.

It would be nice to extend that benefit to download as well, with an
additional benefit of being able to share more code between the upload and
download paths.

This is the first in a series of patches that aims to to do just that. The
first step is change the name so that it's not just 'imageupload' but
'image'es in general that the driver is managing.

DocImpact

Change-Id: Ia18b82568147a9a40b0da67d74bf20b12d08b9a9
Performs hard reboot if libvirt soft reboot raises libvirtError

Currently the libvirt driver will only attempt a hard reboot if a soft
reboot fails and returns False. If a libvirt exception is raised,
however, the hard reboot is not attempted. This patch wraps the soft
reboot in a try block to continue with the hard reboot attempt if a
libvirtError is raised.

Fixes bug 1202974

Change-Id: Ifaff75b33b5123cdd3293e8f263ccb4f72ae726a
Merge "Refactor compute API's delete to properly do local soft_deletes"
Merge "xenapi: Rename imageupload image"
Merge "Fix multi availability zone issue part 1"
Merge "Make delete/soft_delete use objects"
Merge "Cleanup copy/paste in test_quota_sets"