Fix v3 hypervisor extension servers action follow REST principles

The orignial hypervisor servers action as below:
'/os-hypervisors/[filters]/servers'

Change it as:
'/os-hypervisors/[hypervisor id]/servers'
And tt will return all the servers on the specific hypervisor.

Partially implements: bp v3-api-extension-versioning

DocImpact

Change-Id: I6c252372af67eda79f670199deb6592c02603c33
Config drive attached as cdrom

Some guest OSes (e.g. Windows) require config drive to be a cdrom device
to access the iso9660 filesystem on it. Option config_drive_format is
therefore set to also control the device type of config drive. If it's
set to 'iso9660', config drive will be cdrom; if it's 'vfat', config
drive will be disk.

DocImpact
Fixes: bug #1155842
Change-Id: I6c08b1b8040a1fd0db8e2b3b1fc798060733001f
Implements host uptime API call for cell setup.

Fixes bug os-hypervisors/<id>/uptime fails in cell setup.Implements
'get_host_uptime' for cells_api, which returns hypervisor uptime
from the target child cell.

Fixes bug LP 1192911

Change-Id: Iac75e46e565f17c91117dcb810f6d2f2e62708d8
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
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
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 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
Correct status code and response for quota_sets API v3

* Modify the response of update quota include 'id' that is same
with show quota.
* Change the status code of delete to 204.
* The request body of update have needn't 'tenant_id' and 'id', so remove them
from NON_QUOTA_KEYS.

Partially implements bp v3-api-extension-versioning

Change-Id: Id5bb149a911fa992a5cd374a3666ebfa976ec2c3
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
Fix flavor_access extension follow API V3 rules

* Add decorator expected_errors
* Correct the naming style for add/remove tenant access
* Add exception FlavorNotFound catching for add/remove tenant access
* Improve input validation for add/remove tenant access

Partially implements bp v3-api-extension-versioning

DocImpact

Change-Id: Icbf92115be6f33f943b3663373f84e1b12895225
Add expected_errors for extension server_diagnostics V3

Partially implements bp v3-api-extension-versioning

Change-Id: If31567284014e6479c9e0dd313f74adce6ae8058
Merge "Config drive attached as cdrom"
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
Merge "Implements host uptime API call for cell setup."
Merge "Fix flavor_access extension follow API V3 rules"
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
Merge "Fix v3 hypervisor extension servers action follow REST principles"