Fix reserve_block_device_name while attach volume

The block device name will not  be reserved in current implementation
due to missing volume_id in block_device_mapping. This will cause
block_device.instance_block_mapping does not return the ebs device
which should be reserved.

This patch adds the volume_id to block_device_mapping while reserving
block device name.

Fixes bug 1062033

(Similar to dcabd6159abcdccd99e55495ec005926465007a8 and
66f1a34cabc26930db2a1afed5a0f5ced4d1c015 which fixed the issue in
trunk)

Change-Id: I8f08b568619fefa99850de0bee7d605749d53b0a
Fix Broken XML Namespace Handling

nodeName is set to ns2:metadata and not just metadata when namespaces are
specified using first example in the defect. Explicitly check namespaces
where necessary and use localName instead of nodeName.
Ensure that scheduler_hints are picked up from the correct namespace

fix lines too long from pep8

Fixes bug 887191

Change-Id: I5db2b575d24f6b1b358489e309af7e6ace2950fd
(cherry picked from commit 10caf4b48fa67b160e6024a801efbda292d44ebf)
Merge "Fix reserve_block_device_name while attach volume" into stable/folsom
Proxy floating IP calls to quantum

Fixes bug 1023169. Also fixes bug 1031119.

In Folsom, floating IP support is moved to Quantum. By this commit floating IP
calls to nova are proxied to Quantum and nova command can be used to manage
floating IPs.

pip-requires is also updated and now requires python-quantumclient >=2.1 which
supports floating IP feature in Quantum.

Change-Id: I2c32948a8fe291601216dc62d546da64a8fb8428
(cherry picked from commit 7948b7a572e33e3fd541e27f2617d832eb43b504)
Stable oslo (aka common) update

Updated all of the stable code. This addresses critical issues with qpid
messaging, support for windows, etc.

Change-Id: I60c54b608efef472b893d7296ab9c0caa538ca49
Fix signing_dir option for auth_token middleware.

The keystone auth_token middleware expects an option named
'signing_dir'.  The sample api-paste.ini file for nova defined
'signing_dirname' instead.

Fix bug 1073858.

Change-Id: Ie9a3df73a8d9d52b48d6e0bcce0aae762af929a9
(cherry picked from commit a754825c6a91d1e7b2db6a2b49de1ca65370cb21)
Ensures compute_driver flag can be used by bdm

Fixes bug 1063851 by moving compute_driver flag from
compute/manager.py to the global flags.py

Change-Id: I337795f6956050b398c39a8476e3c1e2b689c470
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Don't verify image hashes if checksumming is disabled.

There was a bug where we were checking base image checksums, even
if checksumming was disabled, if there was already a cached checksum
for the image. This resolves bug 1075017.

DocImpact

Change-Id: I38f5914cd9d6326fdf5e5d7f0f57885ff8b5ff32
(cherry picked from commit 1442177d5d1c388d75e7d7f0316e2c2891f5b779)
Merge "Fix Broken XML Namespace Handling" into stable/folsom
Merge "Don't verify image hashes if checksumming is disabled." into stable/folsom
Merge "Ensures compute_driver flag can be used by bdm" into stable/folsom
Merge "Proxy floating IP calls to quantum" into stable/folsom
Merge "Stable oslo (aka common) update" into stable/folsom
make QuantumV2 support requested nic ordering

fixes bug 1064524

The QuantumV2 did not honor nic ordering, so nics were attached in
Quantum's db natural order.  This patch sorts the networks honor requested nic
ordering when Nova calls the V2Quantum API.  Unit tests have been updated to
confirm ordering is honored.

Change-Id: I44a6a4736c78e86e83b6e682e63f93a5b47652da
don't explode if a 413 didn't set Retry-After

We use 413 error code not only for temporary out of memory
conditions but also for over quota issues. These kinds of
requests don't set a Retry-After header, but the code assumed
that was a valid key, thus exploding on a KeyError. Issue
caught in looking at tempest traces.

Fixes bug #1079387

Change-Id: Id406ab0799a35220b189b2e5292be092eb821ec5
add port support when QuantumV2 subclass is used

fixes bug 1070045

Fix the current implementation by checking if FLAGS.network_api_class is a
subclass of nova.network.quantumv2.api.API.  Previously, the API would
not accept port references unless the network_api_class string was
anything other than the QuantumV2 class.  This limitation prevented
subclassing.

This changeset includes additional API unit tests focused on QuantumV2
and requested networks.

Change-Id: I6b7b7389e127ff8b084ac379cb9aebccc102620c
Eliminates simultaneous schedule race.

Keeps host state in memory so multiple schedule attempts use the
up-to-date values that may have been modified by another greenthread.

Fixes bug 1073956

Change-Id: I69fdd9b46bde6b7408c501c42a6ef3b6dd92bbc2
(cherry picked from commit 94560ab57d9fc23673f42017e6f2a78cb2b66b7a)
Stop network.api import on network import

The nova.network.__init__.py was importing the network.api
automatically at import time. This was leading to some silly
workarounds (for example in nova/virt/firewall.py) involving
late importing nova.network to stop circular imports.

It is also causing issues with https://review.openstack.org/#/c/13007/
because quantum api needs to import a flag from network manager
which is causing a circular import.

This fixes the issue by moving to use the code from volume_api
which only imports the api class when the method is called. It cleans
up the tests that were stubbing out network.API and also removes
the unneeded workarounds.

Change-Id: I4c9b372d078ab4398e797335a8de5e9e1077e31f
Fixes bug Snapshotting LXC instance fails

Fixes bug 1058273.

The path of the disk for snapshotting LXC instance is debugged.
Also, virt_dom.managedSave(0) and self._create_domain(domain=virt_dom)
are not called for LXC instance, because they are supported by libvirt.

Change-Id: Idf8275a0222b2eb289e16dd245f7721e17fce21d
(cherry picked from commit b60646965de26974f8a8b81f6e43b72a6c8d44f5)
Reinstate default FLAGS.compute_driver for folsom

A previous cherry-picked commit moved the compute_driver flag from
the compute manager to the global flags file, but did not take the
flags default value along.  This breaks existing Folsom installations
that still use connection_type.

Note, this is only proposed to stable/folsom to fix a regression. Not
applicable to master as connection_type is gone in Grizzly.

Fixes bug 1081836.

Change-Id: I135d6adc215c40fb9f46f382dbe22fb38b413ff8