Revert "Add requests requirement capped <1.2.1."

Fixes bug 1182271.

This reverts commit c39687edb9138c6eac675b8781a5d4bf5a51c968. The
original workaround is no longer needed, as pip is now configured to
install with the --upgrade flag and will therefore pull a new enough
python-jinja2 into the tox virtualenv even though site packages is
enabled in nova and an older distribution package of the same
library is still present on CentOS 6.4.

Change-Id: I33335314c7c1b26d630137edfa0cdc2d1947432e
Code dedup in class InstanceTypeExtraSpecsTestCase

Moved expected specs to setUp()

bp nova-tests-code-duplication

Change-Id: Id5326ad5445688a806b6667e2189e45c8dcdc69b
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
Speed up test BareMetalPduTestCase.test_exec_pdutool

The test .test_tilera_pdu.BareMetalPduTestCase.test_exec_pdutool had a 9
second sleep in it from tile_power_wait. Set this to 0 for testing.

Change-Id: I294e16b49a11fdfd3b590b3bb970f69a655c75d9
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
return 429 on API rate limiting occur

Currently nova will return 413 instead of 429 on API rate limiting.
Fix it so that the V3 API will not be influenced.

fixes bug 1187676

Change-Id: I25e3f6766597c2475b4fc3203a43b159f0e99739
Move tests test_verify_checksum_* to separate class

Moved tests in virt.libvirt.test_imagecache.test_verify_checksum_*
to separate class.

Removed _intercept_log_messages() from ImageCacheManagerTestCase
and VerifyChecksumTestCase classes and turned it into a
module method.

This commit is the first step in refactoring the file.
It is followed by the commit which removes duplicated code.

bp nova-tests-code-duplication

Change-Id: Ie5bffcabb83ec2208ced343cdf75bf1197b7d5c3
Code dedup in virt.libvirt.test_imagecache.test_verify_checksum_*

Moved shared image and flags values to setUp()

Moved common code to separate functions:
    -_write_file()
    -_check_body()

bp nova-tests-code-duplication

Change-Id: Ic87475075312cbe8c7d7d04c23d394e09b80779e
Remove unreachable code

code cleanup

Change-Id: Iab52371e259197e9f3fc3e1f843293a630f46459
Remove sleep from service group db and mc tests

Before servicegroup.test_db_servicegroup and test_mc_servicegroup used
eventlet to put the test to sleep and waited for the service to run its
periodic _report_state instead of using timeutils and explicitly calling
_report_state.
 By switching to a timeutils fixture The following tests, are removed
from the list of top 10 lowest tests:

nova.tests.servicegroup.test_db_servicegroup.DBServiceGroupTestCase.test_DB_driver
nova.tests.servicegroup.test_mc_servicegroup.MemcachedServiceGroupTestCase.test_memcached_driver

Change-Id: I091a9975cc7e4fccb26700359d1e3b5c165034d3
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
Add notification for live migration call

Fix bug 1183657

Add notification for two live migration API calls:
1) _rollback_live_migration
2) _post_live_migration

Change-Id: Ibb092eae40801f0f7f78876e60dabfaf0e1aab6f
Add expected_errors for extension server_diagnostics V3

Partially implements bp v3-api-extension-versioning

Change-Id: If31567284014e6479c9e0dd313f74adce6ae8058
Moves compute.rpcapi.prep_resize call to scheduler.manager

This change removes the scheduler_prep_resize method from
the scheduler drivers and put the logic on the scheduler
manager instead.

This is part of other changes that will completely move
cold migration related tasks to conductor. Next change
will move the scheduler manager prep_resize logic to
conductor.

Partially implements bp cold-migrations-to-conductor

Change-Id: Iab6d414acfa32eeb36a2b8cf358ce5948652c49c
add vendor_data to the md service and config drive

There was not previously any way for a vendor to extend the metadata
service to include vendor specific or site specific information.

This adds an entry named 'vendor_data.json' to the metadata service, and also
to the rendering on config-drive.  vendor_data is intended to be a un-managed
place for cloud providers to put custom data that will then be available to the
instances.

The class used to generate the data is configurable via the flag
'vendordata_driver'.  The default class, JsonFileVendorData simply
loads data from a file that is configurable via 'vendordata_jsonfile_path'.
If that variable is not set, a empty dictionary is returned.

By setting
 vendordata_jsonfile_path = /etc/nova/vendor_data.json

The cloud provider can then expose custom data to all instances.

blueprint vendor-data
DocImpact

Change-Id: Ie2aceff1bf68edab124cd5f889aa9a8adcdc73c0
Add error checking around host service checking

If the host provided doesn't exist in the table, nova-manage will spit a
traceback out, which isn't very friendly. This patch copies the same
code used in other nova-manage commands to wrap the offending call.

Change-Id: I606b22f0cea523809fcfa34f5b61ce70ba8d6152
Remove * import from xenserver plugins

Recently a change was made to how/where the '_' method is imported. This
seems to have broken most xenserver plugins. These plugins shouldn't be
doing * imports anyway so I've gone in and cleaned up all places where
"from pluginlib_nova import *" was used and replaced with "import
pluginlib_nova".

Fixes bug 1207107

Change-Id: I3b2a299cf60543e0f766becfeb4740af791b3576
Use cached nwinfo for secgroup rules

This stops a potential DOS with source security groups by using the
db cached version of the network info instead of calling out to
the network api multiple times.

Fixes bug 1184041

Change-Id: Id5f24ecf0e8cce60c27a9aecbc6e606c4c44d6b6