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
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
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"
Merge "libvirt: Catch VIR_ERR_NO_DOMAIN in list_instances"
Merge "Mox should cleanup before stubs"
Merge "Fix header issue for baremetal_deploy_helper.py"
Merge "Don't inject settings for dynamic network"
Merge "Add ca cert file support to cinder client requests"