Ensure changes to api.QUOTA_SYNC_FUNCTIONS are restored.

Add a local callable restore_sync_functions() that is
established as an addCleanup() fixture callable,
making use of a copy of the QUOTA_SYNC_FUNCTIONS
dictionary to restore its previous contents in-place.

Change-Id: I7fa69ea91e517121aba0ee22a71b0594591ae308
Closes-Bug: #1329482
Drop support for conductor 1.x rpc interface

In commit 330ce897c14f66a39426e716f02a620453035c15, a part of
Icehouse, we added support for the 2.x interface.  Now that Juno
development is open, we can drop support for the old API, 1.x.

For more information on this change, see:

    https://wiki.openstack.org/wiki/RpcMajorVersionUpdates

UpgradeImpact

Change-Id: Id7e605d493a53eaaa2a9afa0c99ac721f590ca3f
Fix Flavor object extra_specs and projects handling

The Flavor.save() method was not properly handling extra_specs
and projects when deletions occur, and was doing a read/edit/save
cycle, which could involve some stale data.

This patch keeps the object-y interface to adding/removing things
from those lists, but ensures that they're added/removed individually
on the backend. The save() method is strange on Flavor, in that only
these two sets of data are actually mutable. Because of this, it's
fairly convenient to make that method no longer remotable and
break the actions into two new remotable methods that take fine-
grained lists of add/remove tasks.

Note that Flavor was not used over RPC in any previous release,
so the remotability change doesn't really affect anything. However,
if a client were to issue a remoted save() call, it would still work
and would still have the same (broken) behavior as before, where
deletes don't propagate and we just always add/update every key.

Related to blueprint compute-manager-objects-juno

Change-Id: Ic4439e05b9c0b8274e54768cbd7949aced45cc69
VMware: remove unused code in vm_util.py

Remove a few functions not used anymore and not tested. This increases
the code coverage and decreases the time devs scrolls through the file.

Change-Id: I8398bceb8771d9c180bcd6cbafbf1f3e839f9307
Fix resource cleanup in NetworkManager.allocate_fixed_ip

NetworkManager.allocate_fixed_ip isn't cleaning up the resources it
allocates in the event of a failure. This means that if, for example,
_setup_network_on_host fails, the instance will still have a fixed IP
allocated to it. Every attempt to spawn the instance will result in
another fixed ip being allocated.

Closes-Bug: #1328539

Change-Id: Idfa1f4015acb10dc14fcec448257bcfe6971fc99
Object-ify APIv2 flavorextraspecs extension

This makes the flavorextraspecs extension use the Flavor object.

Related to blueprint compute-manager-objects-juno

Change-Id: I28bcc24382f1e993b98b3f7342fed53c9ae85cbf
Object-ify APIv3 flavor_extraspecs extension

This makes the APIv3 flavor_extraspecs extension use the Flavor
object instead of going direct to the database.

Related to blueprint compute-manager-objects-juno

Change-Id: Ibe9211fb944bb64f722e2417725e29506b17ee30
Target host in evacuate can't be the original one

'Evacuate' function aims to help administrator/operator to evacuate
servers if this compute node fails.

If no protection, the API returns a successful response,
but the vm_state will be changed to ERROR after nova-compute started,
due to the 'InstanceExists' exception raised from 'rebuild_instance()'.

So we need to add verification here, the target host should not be the
original host.

Change-Id: Ic468cd57688b370a18cacfc6e0844a8201eb9ab3
Closes-Bug: #1271821
Correct the variable name in trusted filter

Rename instance to instance_type to avoid misunderstanding

Change-Id: I88f8d31074d7547649c242a023b18143a0092fea
Merge "Fix resource cleanup in NetworkManager.allocate_fixed_ip"
Merge "Fix Flavor object extra_specs and projects handling"
Merge "Object-ify APIv2 flavorextraspecs extension"
Merge "Object-ify APIv3 flavor_extraspecs extension"
Fix bug in TestObjectVersions

The object version hash trap test was incorrectly hashing over
None instead of the list of object fields. This patch fixes
that and updates the hashes accordingly.

Change-Id: I217b65e7dfee7b77c5ab7b0b7c8bf06cafe8bcca
Merge "Ensure changes to api.QUOTA_SYNC_FUNCTIONS are restored."
Merge "Target host in evacuate can't be the original one"
Merge "Fix bug in TestObjectVersions"
Merge "VMware: remove unused code in vm_util.py"
Merge "Correct the variable name in trusted filter"
Merge "Drop support for conductor 1.x rpc interface"