Copy the RHEL6 eventlet workaround from Oslo

Tests in oslo-incubator now need the horrendous hack to workaround an
issue with eventlet on RHEL6. We've moved the patch_tox_venv tool
and redhat-eventlet.patch into oslo-incubator, so add them to
openstack-common.conf.

Change-Id: I1acfec282b64d7582144b155119bedb1741db2f7
Optimize instance queries in compute manager

Some instance queries against the db through the conductor can be
optimized to return a reduced set of instances as needed for the job
at hand. Most of these are part of periodic tasks, so the win is
kind of big.

Compute methods where queries can be made more efficient:

_get_instances_on_driver
_poll_rebooting_instances
_poll_rescued_instances
_reclaim_queued_deletes
_run_image_cache_manager_pass

Resolves bug 1169970.

Change-Id: I7c2fab48944e34765b3fff8ce10bc64a5cd826c8
Architecture property updated in snapshot libvirt

During an instance snapshot if the architecture property is defined
in the image it is updated twice in the snapshot image.
The snapshot is created with the metadata values from the
"instance_system_metadata" table and then, if defined, the architecure
property is updated from the value in the base image in that moment.

There is no reason to treat this property differently from others.
Also, it didn't respect the "non_inheritable_image_properties" option.

This change removes the special behavior for the architecture property
in the libvirt driver during a snapshot.

Fixes: bug #1176173
Change-Id: Ic5b4e3d462c08df167e14522fa25a7cf857c6aad
Fix header issue for baremetal_deploy_helper.py

Fix header issue

baremetal_deploy_helper.py is not a python script which can not
be run directly, so there is no need to keep "#!/usr/bin/env python"
but change it to "# vim: tabstop=4 shiftwidth=4 softtabstop=4"

Change-Id: Ic4957673605cd71dc19fc38a2626bdaa35d102c0
Sync service and threadgroup modules from oslo

blueprint use-oslo-services

Change-Id: I8641dbed0a83a6d57c0b6c1a02796eb3e633fafd
Detach volume fails when using multipath iscsi

Enabled multipath for libvirt iscsi volume driver. Attach volume worked,
however, detach volume failed. It failed because it can't find multipath
device "/dev/mapper/xxxxxxxx" from connection_info and block device
mapping table.

The fix is to retrieve multipath device info dynamically at detach time.

Fixes: bug #1178893

Change-Id: I53a3888daef93b57bf7f57438f74cee05e794b52
Convert Nova to use Oslo service infrastructure.

Convert Nova to use the Oslo versions of:
* Service
* Launchers

Also add Service timers to the Service ThreadGroup.

blueprint use-oslo-services

Change-Id: Id8ab017f4525afd69fed322311f2d5cc3b6d6f98
Improve unit tests for DB archiving.

Test all tables that have a uuid column and no constraints that make
generic testing difficult, rather than just a couple of tables.

Make the teardown code more generic.

Add test_archive_deleted_rows_2_tables, which tests that we can
archive rows from two tables in one call.

Change-Id: If08aac3c6869820c72dfcb1bf6d22d19c2995c8a
Fix whitespace issue in indent

Extra whitespace cleanup in nova/cells/messaging.py

Change-Id: I000b2585ab9018af42f25bc83e7e0b0c2bd92e5a
Fix for missing multipath device name

Due to formatting changes in the multipath -l output
we were sometimes missing the device name for each of the
multipath devices which gave us a device of '/dev/'.  This
causes problems on detach.

Fixes Bug: #1180497

Change-Id: I6017dda149776624fac452140d3d0f5df3f5fd5a
libvirt: Catch VIR_ERR_NO_DOMAIN in list_instances

Commit 25f50d9a didn't catch the exact exception for
looking up deleted domain.

Partly fixes LP Bug #1032741.

Change-Id: I6c6f7d8a736c833488b6cb8e00530dc4138f1424
Add ca cert file support to cinder client requests

Allow for ca certificates file to be specified when doing cinder
client requests. Needed when using custom ca authorities.

Change-Id: Ib9aa15df2fc7d96cb8587c13769399e353c032c6
Fixes: bug #1179476
Merge "Detach volume fails when using multipath iscsi"
Merge "Fix for missing multipath device name"
Merge "Architecture property updated in snapshot libvirt"
Merge "Copy the RHEL6 eventlet workaround from Oslo"
Don't inject settings for dynamic network

When using Quantum for networking and setting flat_injected to
inject network settings into the guest VM, Nova injects a static
network configuration for networks using DHCP. This change
checks for the existence of a dhcp server and, if found, does not
inject static settings for that network.

Due to limitations of the legacy network info, the fix only
applies when new-style network info is passed to the injection
template function.  The only code still passing in legacy
network info is in libvirt, and there is work ongoing to
remove that dependency.

Fixes bug 1163985
Fixes bug 1112659

Change-Id: I8d3f16bde22e1c6dc0d2432aa263e2b15ae5c93a
Reverse compare arguments in filters tests

When using assertEqual, the expected result should actually be the first
argument so any failures have 'expected' and 'actual' values printed
properly.

Change-Id: I34d16f298eb0bf62e2abaaf31e80911fa124dc24
Mox should cleanup before stubs

Tests that define both Mox and Stubs may not receive a proper cleanup by the
`TestCase` base class. The reason is that the order in which the Mox and Stubs
are unset may not necessarily match-up with the order in which the tests
called them. For example:

Suppose we have a test that Stubs a method in its `setUp` and then Mox's that
same method in the test body:

    Stub: Original-Func -> Stubbed-Func
    Mox: Stubbed-Func -> Mocked-Func

Now when `TestCase` ultimately does its `cleanUp`, it will UnStub before
UnMocking:

    UnStub: Stubbed-Func -> Original-Func
    UnMox: Mocked-Func -> Stubbed-Func

Notice that generic cleanup has mistakingly left `Stubbed-Func` in place.

Given that Stubs and Mox can be performed in any order, the upshot here is
that the generic cleanup can't always be relied on.

The proposed solution has two parts: a best-practice change and a small
code-change.

The code-change is to reverse the current order to UnMox before UnStubbing.
While in theory the order is arbitrary, in practice, we have lots of Stubs in
`setUp` methods already, so UnMox'ing first makes sense (and it fixes a
current bug to boot!)

The best-practice change is to recommend against stubbing and mocking the same
function as well as to always place stubs before mocks when relying on the
generic cleanup. If a developers needs to deviate from this, cleanup of stubs
created after mocks are their responsibility.

Fixes bug 1180671

Change-Id: I42ab8b55026c0a133625a7cc81ed8b960e9d47d7
Merge "Reverse compare arguments in filters tests"