Don't need to init testr in run_tests.sh

In run_tests.sh, function init_testr will initialize testr if the
directory .testrepository is not existed. Actually, testr will do
the check before run the test:

In Python package testrepository, setuptools_command.py:Testr.run

68 def run(self):
69     """Set up testr repo, then run testr"""
70     if not os.path.isdir(".testrepository"):
71         self._run_testr("init")

So, init_testr can be removed safely.

Fixes Bug #1211098

Change-Id: I4bd2ef3dc107281892732efced268eb3b7c90cbb
Fix HTTP response for PortInUse during boot (v3 API)

If an in use port is passed as a network parameter in the request, Nova API
should raise an HTTPConflict (409) error. This was fixed in commit
48b31c9a1f5d2a45d881e70c6223411c5abbcb72 for the V2 API but not the V3 API.

Fixes bug 1212098

Change-Id: I94429f2c04cf81cb88a8739f65a49aa7ca0d49bd
Raises masked AssertionError in _test_network_api

The _test_network_api method was catching an AssertionError to do some
more checking but failed to raise the original error if the checking
didn't hit any matches. This patch fixes the test to raise the original
assertion error.

Closes-Bug: #1212017

Change-Id: I33147d18e33cd4babfc3f5cb572007bc7e4c07e6
Implement front end rate-limiting for Cinder volume

Cinder adds Quality-of-Service control interface to allow admin to
specify QoS parameters as well as the place where these parameters
should be consumed (Front-end: Nova Compute, Back-end: Cinder
Volume, or Both) for volume types.  KVM and other hypervisor is
known to be able to do disk rate-limit control (one form of QoS)
for virtual disks, this patch enables Nova Compute to extract
rate-limit parameters for volumes while attaching, currently
libvirt only.

implement bp volume-rate-limiting

Change-Id: Ibcc8f15ab744600e6f814b46935f8022d78074fc
Fix untranslated log messages in libvirt driver

Fixes bug 1213040

Change-Id: Ib3b7a46c312b88778cc6e872a2c19061a5774125
fix volume swap exception cases

Currently when the target instance id doesn't match with the instance_id of the
volume to be replaced VolumeUnattached is raised, and InvalidVolume would be a
fittest response.
In the other hand, currently, when the volme to be replaced is not attached at
all InvalidVolume is raised, and VolumeUnnatached would be a fittest response.

Change-Id: I661b97762af70765ab8111313d24cf1a175f7e6c
Added test case in test_migrations for migration 208

This patch is to add test case in test_migrations.py for migration 208.
Migration 208 was brought by commit 74b024f75403c168b5c69ee67a16d1053965e5db
(Change-Id: I72371260159c9fdffcdb57209095fc103b6dd79e)

Change-Id: I153abf260716c8af61d7ccf554d91ba80f559e60
Signed-off-by: Shane Wang <shane.wang@intel.com>
Correct the status code to 201 for create v3

Partially implements bp nova-v3-api

DocImpact

Change-Id: Ie7413f0f6473ad12b84f84688c7c8c377ebf39e1
Object support for instance groups

The patch set adds object support to the instance groups.
This is required for: https://review.openstack.org/#/c/30028/

This is part of the blueprint instance-group-api-extension.

Change-Id: I599016b7a15d6045ae5129352eacc60a37ac7106
Fix aggregate creation/update with null or too long name

Fixes aggregate creation so an attempt to create an aggregate with
a null name results in a 400 Bad Request rather than 409 Conflict.
This was fixed for the V2 api in 43f9028f84ffec9b465bec10025ba75266c1bc22
and is fixed in this changeset for the V3 api

For both the V2 and V3 APIs adds a check to ensure that the aggregate
name is not longer than 255 characters.

Also fixes null or too long names when updating an aggregate

Fixes bug 1212240

Change-Id: I644a8a46f0b75e3717ecafec1889ce6316ca18c6
Removes fixed ips extension from V3 API

The fixed ip extension was one of the first ported to the V3 API
but a later decision around not supporting nova network in the V3 API
means that this extension is not required for V3. The fixed ip extension
only supports nova network, not neutron and the same functionality
can be accessed directly through neutron.

Also changes some extension tests to use a different extension
for white/black list testing

Partially implements bp nova-v3-api

Change-Id: Ie589170e863ee489661e789c5134ed8349ced279
Fix typo in baremetal docs

instanse_type_extra_specs=>instance_type_extra_specs

Change-Id: I8075d1e535e74616d7f1c05ba69f1c9f4c9d4293
Add volume snapshot APIs to driver interface

Add volume_snapshot_create and volume_snapshot_delete to the virt driver
interface.  This is needed to be able to do hypervisor assisted snapshot
operations.

Part of blueprint qemu-assisted-snapshots

Change-Id: I933e000ee56430365f9e380196714f43a85f147f
Add db.block_device_mapping_get_by_id

Add a new db API method for getting a block device mapping for a given
volume ID.  This is needed when Cinder calls over to Nova asking nova to
complete a snapshot operation on its behalf.

Related to blueprint qemu-assisted-snapshots

Change-Id: If3f011e2db14235f4137c9d9cb610f0c4cd7954a
Add DocStrings for function allocate_for_instance

Add DocStrings about params for function
API::allocate_for_instance.

Change-Id: I1dd1625ed6ebd1dfee6dc71f7227302f3e0ece9f
Adds Flavor ID validations

* Flavor ID should not contain special symbols.
* Flavor ID should be in range 1-255 characters.
* Flavor ID should not have leading/trailing whitespaces.

Fixes LP Bug 1202136
DOCIMPACT

Change-Id: I63c36811a57982e826f22f827f86d40ff6a6210e
Fix error messages in v3 aggregate API

Since moving error messages to HTTP responses from LOG.info()s,
the error messages has been unexpected formats like:
  "Cannot delete aggregate: %s <id>"
This patch fixes them.

Partially implements blueprint nova-v3-api

Change-Id: Iadc41ab254c1f17efdb08f23449a0bd7a94a8f6c
Fix the message of coverage directory error

If a coverage-report directory conflicts, the error message is
incomplete like the following:

$ nova coverage-start --combine
Coverage collection started
$
$ nova coverage-report --html test01
Report path: /tmp/nova-coverage_Krl__k/test01
$
$ nova coverage-start --combine
Coverage collection started
$ nova coverage-report --html test01
ERROR: Directory conflict: %s already exists (HTTP 400)
$

This patch fixes the message.

Fixes bug #1217315

Change-Id: Ie21b0e87262a3caef36d93711ee96529ec699cec
Store CONF.baremetal.instance_type_extra_specs in DB

The baremetal driver supports sending back arbitrary key value pairs via
RPC for scheduling purposes.  Since the rpc fanout is being removed
store these values in the database in the ComputeNodeStat table.

A separate patch will update the compute_capabilities_filter to use
these values.

part of bp no-compute-fanout-to-scheduler

Change-Id: I03d20484cd78f9cd64dcc3d270b2882c6ab12195
Mock out action event calls in build instance test

action_event_start() and action_event_finish() get called during the
build instance tests and if we time out call()s in the fake RPC driver
when there are no consumers for a topic, then these tests will fail.

blueprint: oslo-messaging
Change-Id: Ib109fa9552dc6032b390c300723bb6cb72d62062