Port ips-extended to API-v3 ips core API Part 1

This just copies servers and ips xml schema to API-v3.

Change-Id: I4f096cfe7c453123a0adb8e6e969ff3c592324db
Port ips-extended to API-v3 ips core API Part 2

This includes on ips responses extended ip information: mac address and type,
adds V3 version of the views and the tests to also test this information, which
affects servers and ips core API.

related to bp nova-v3-api

Change-Id: I699f6e27b53663f358b63615e7dd0f1627c4730b
Adds NoAuthMiddleware for V3

Adds a V3 version of NoAuthMiddleware which returns a url which
unlike the V2 version does not include the tenant_id in the url.

Also fixes bug with the V2 version where it would create broken
urls on Windows because os.path.join was used

Partially implements blueprint v3-api-remove-project-id

DocImpact

Change-Id: I7ecffea52c3662344ac694997bb08a16506abbbd
Fix extension hosts follow API v3 rules

* Add decorator expected_errors
* Rename parameter 'updates' to 'host' for update
* Add input validation
* Tidy up exception catching

Partially implements bp v3-api-extension-versioning

DocImpact

Change-Id: Ic7858460a1ebaf2e1981792b837e5858c7e9cccf
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
Remove unreachable code

code cleanup

Change-Id: Iab52371e259197e9f3fc3e1f843293a630f46459
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
Fixes for v3 API servers tests

Fixes some v3 API servers unittests to correctly use the
fake v3 wsgi_app rather than the v2 one. Also fixes
xml in test_update_server_invalid_xml_raises_lookup so
that it will only cause a LookupError rather than a LookupError
and an ExpatError as the latter will mask the failure of the former
to be raised.

Also adds checking of the actual error message returned for the two
unittests affected.

partially implements blueprint v3-api-unittests

Change-Id: I2abf8875e2cc3feda14f93d8c1e7a88c5a278ca8
Sync config.generator from Oslo

Includes:
7448e7e Fix hostname conflict in config generator

Fixes bug 1205411

Change-Id: I13988ef73db05bbdab355400c19e1ad136b59fc0
Demote admin-passwd from core of API v3 as extensions os-admin-password

This patch move the action 'change_password' from core into extensions.
* Catch exception InstancePasswordSetFailed explicitly
* Add decorator 'expected_errors'
* Change naming style of action name and attributes
* Add testcase

Partially implements: bp v3-api-extension-versioning

DocImpact

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

Partially implements bp v3-api-extension-versioning

Change-Id: Ic9b2bebc5974a47beebee6bd6eba192ee0ede74b
Make EvacuateTest DRYer

Each test in EvacuateTest creates request and application objects on its
own, so extract that to an isolated method to avoid code duplication.

blueprint nova-tests-code-duplication

Change-Id: Id0778b2cbb41edccd16820fa19de7951a7196f77
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
Add index to reservations.uuid column

Committing or rolling back reservations gets slow once a large number of
reservations have built up in the db.  Since they're being queried by
uuid this adds an index to speed up that operation.

Note that this can be slow with a large number of rows.

bug 1203872

Change-Id: Ida503206194a567a5c6811a304154d067c5faa83
Add support for Neutron https endpoint

This patch adds a parameter to specify Neutronclient ca certificate file
location to support Neutron https endpoint.

Fix bug #1206330

Change-Id: I9ecdd24cf0efcb5ef895e529e516d248214592c1
vendor-data minor format / style cleanups

This just adds a couple minor style and formatting cleanups to the
vendordata code.

Change-Id: I440689a51db98d4aaa581c45dba1660488355da3