Pass expected_attrs to instance_get_active_by_window_joined

This change sends the expected_attrs from the instance object
API down into the DB API so the client can filter on which
columns he actually needs to join when getting all instances
in a given time window.

The simple-tenant-usage API and _instance_usage_audit periodic
task are the only things calling this API and they already
provide specific expected_attrs so there is no risk of
regression due to the change. The DB API is backwards
compatible if columns_to_join is None, and expected_attrs
defaults to None already.

Change-Id: I3d8b5a1fd58783e465001bb5f10b5b87d69198d9
Partial-Bug: #1383469
Fix bulk floating ip ext to show uuid and fixed_ip

The bulk floating ip extension was not showing the instance_uuid
or the fixed_ip properly due to a missing join and an ommision
when the extension was first created. This updates the extension
to display all of the relevant data.

Change-Id: I81c2c742a7eed134b5452c19da0cc55811c009ab
Closes-Bug: #1360426
Convert service v3 plugin to v2.1 API

Changes required to have v3 plugin natively support the V2.1
API

Remove the 1st level dict of service in the body param

Partially implements blueprint v2-on-v3-api
Co-Authored-by: Chris Yeoh <cyeoh@au1.ibm.com>
Change-Id: Ida59f00e3cf4640b63add1d6350aa7c30529807e
Port volume_attachments extension to v2.1 API

This patch ports v2 volume_attachments & volume_attachment_update
extension to v2.1.
Unittest code modified to share testing with both v2/v2.1.
API sample file and their tests have been added.

Partially implements blueprint v2-on-v3-api

Change-Id: Icf63529f317bc61debc665641d1c9d9f2e45bcec
initialize objects with context in cells

These changes aim to clean up the pattern of passing a context in
object member functions create/destroy/refresh/save and instead
initialize the object with the context when it's constructed.

Related to blueprint kilo-objects

Change-Id: I5a7e3c1da6f9e2efaf296dd392e5ce9942c5729c
initialize objects with context in server groups api

These changes aim to clean up the pattern of passing a context in
object member functions create/destroy/refresh/save and instead
initialize the object with the context when it's constructed.

Related to blueprint kilo-objects

Change-Id: Ieb405b5cf8de40024a175771fba2f4c296af9e78
initialize objects with context in resource tracker

These changes aim to clean up the pattern of passing a context in
object member functions create/destroy/refresh/save and instead
initialize the object with the context when it's constructed.

Related to blueprint kilo-objects

Change-Id: I47c25c144d1f970781d6288073041501966f0178
initialize objects with context in compute api

These changes aim to clean up the pattern of passing a context in
object member functions create/destroy/refresh/save and instead
initialize the object with the context when it's constructed.

Related to blueprint kilo-objects

Change-Id: I3781bd5fb7de0ff578ea4342be5cb68eef52c43d
Retry ebtables on race

Calls to ebtables can race with libvirt and cause nova, or libvirt
to fail to apply ebtables rules.

The goal of this patch is to provide a simple fix to improve the
stability of the gate.

We now call ebtables in a simple loop that retries on failure.
Long term we want to update nova to make use of the --concurrent
flag in newer versions of ebtables. The --concurrent flag
implements a lock to prevent multiple invocations of ebtables from
racing. This will require a newer libvirt and the ability to
timeout long running execs (--concurrent can block forever if it
never gets the lock).

A future patch is forthcoming to add support for --concurrent.

DocImpact
Add ebtables_exec_attempts option (default=3).

Change-Id: I3e04782ac4678581462f9bee4bb10d5f3b223457
Partial-Bug: #1316621
Add "x-compute-request-id" to a response header

The commit I5e370fd3de5ee2f8a8d13553015d88910ff5ea87 changed
"x-compute-request-id" to "x-openstack-request-id" on v2.1 API.
But this change is backwards incompatible against v2.0 API.

This patch makes all v2.1 APIs return "x-compute-request-id" in
the header.

Partially implements blueprint v2-on-v3-api

Change-Id: Ibe46e4004a7124ddc9a622fa7f26b9ec10a9a702
hardware: clean test to use well defined fake flavor

Removes FakeFlavor and FakeFlavorObject to use objects.Flavor
which what hardware methods are expected to use.
Aslo this will help to move some tests from hardware to
objects.

Change-Id: Ic08c9cf0d9147afd7ef2a3d7742960cba6817046
Remove Python 2.6 classifier

Nova does not support Python 2.6 anymore starting with Kilo and might
not work correctly with it, so remove the classifier.

Change-Id: If60c60af9ae28ce91bdcc3f7f47c906ec8250dd1
dummy patch to let tox functional pass

Tox functional job currently will fail because there are no tests,
which is makes it a little hard to atomically turn on voting with the
test move. To trick the system we can make tox functional always pass,
then change the tox definition to the real thing during the sideways
move.

Part of bp:functional-tests-for-nova

Change-Id: Ic276522851fba6d1d95dd1f3bdde1d48935568a3
Merge "Pass expected_attrs to instance_get_active_by_window_joined"
Merge "Remove Python 2.6 classifier"
Merge "dummy patch to let tox functional pass"
Make get_image_metadata() use Instance.get_flavor()

This cleans up the last use of extract_flavor() in compute/, aside from
resource tracker.

Related to blueprint flavor-from-sysmeta-to-blob

Change-Id: I2a5c2b5d2220a05ea7e921f7d7077c6880fbc5bb
Make compute/api.py::resize() use Instance.get_flavor()

This is actually a teensy change, but along with it come a lot of fixes
to tests that were still passing instance dicts to this method.

Related to blueprint flavor-from-sysmeta-to-blob

Change-Id: I6eb905730e4a61628a2ac94f752fc56786e952d2
Merge "hardware: clean test to use well defined fake flavor"
Merge "initialize objects with context in cells"