Improve performance of safe_log().

This patch addresses a minor performance regression in a recent change
to this function.  This change ensures that the deep copy is only done
if we really need to.  Previously, the deep copy was being done for all
messages that included a 'method', not just messages with a method that
contain an argument to be sanitized.

Change-Id: I190c5963ecaf70b0aea4e12a2fdc19deb5c1fea2
Merge "Add another libvirt get_guest_config() test case"
Merge "Fix 'nova-manage config convert'"
Don't set instance ACTIVE until it's really active

Fixes bug 963656

Reverting a resize would end up setting the instance ACTIVE before the
driver had finished all of the work starting up the original instance.
If the instance is deleted quickly after the revert, a race condition
could occur between restarting the original instance and deleting it.

Change-Id: Iba26ad7d1bc1049137f94e13898be86698963fb3
Merge "Improve performance of safe_log()."
Clean up the shared storage check (#891756)

The shared storage check for live and block migration is currently
very confusing e.g.

  * The mounted_on_same_shared_storage() method raises FileNotFound
    for the caller to catch rather than just returning a boolean to
    indicate whether the hosts share storage

  * mounted_on_same_shared_storage() has a "filename is not None" check
    in its finally clause which doesn't make sense

  * InvalidSharedStorage is not raised in the live migration case,

  * instead
    FileNotFound is raised

Clean all this up by having mounted_on_same_shared_storage() simply
return a boolean and have simple logic to raise InvalidSharedStorage for live
migration where no shared storage is available or for block migration where
shared storage is available.

Change-Id: I96f354fe41d9ce77c4cc98903f0d5a9de99ac4f6
Fix unrescue in invalid state

Fixes bug 965667

Unrescue did not check for InstanceInvalidState exception and return the
appropriate error.

Change-Id: I3ca2c1dae09bd149086bfe67e2233c8359d5c8f8
Merge "Don't set instance ACTIVE until it's really active"
Destroy src and dest instances when deleting in RESIZE_VERIFY

Fixes bug 963630

Since deletes are allowed during RESIZE_VERIFY, we need to ensure that
the original instance is also deleted so we don't leak resources.

Change-Id: Ibfd5ad4e427c247f1cd5fddcf4f43b30839a6c4f
Merge "Clean up the shared storage check (#891756)"
Handle Forbidden and NotAuthenticated glance exc.

 * Remove references to deprecated NotAuthorized exception
 * Handle Forbidden and NotAuthenticated
 * Fixes bug 965540

Change-Id: Ib5eef3015239e0fafdb01c975a0f5d553f70519e
Merge "Destroy src and dest instances when deleting in RESIZE_VERIFY"
Reduce the image cache manager periodic interval.

When this code was written, I (incorrectly) believed a periodic
task tick was about a second. It turns out that by default they're
between 60 seconds and 120 seconds depending on a random value.
Therefore, reduce the interval to something more reasonable.

Change-Id: Id840c755f954e3e371d7238243f2248e8d402c7b
Merge "Handle Forbidden and NotAuthenticated glance exc."
A missing checksum does not mean the image is corrupt.

This is a logic error in the code. A missing checksum should not
imply that the image is corrupt. Note that corrupt images are only
logged, not removed, so there is no data loss for users with this
bug.

Change-Id: Ic644517d3b8e9646fe943e5cef485c4168ebb5b5
Merge "Reduce the image cache manager periodic interval."