Bad except clauses order causes wrong text in http response

InstanceInvalidState is an ancestor class of InstanceIsLocked, so
we need to catch InstanceIsLocked first. Fix the test case to
ensure we get the right http response back

Change-Id: Id22b284d9b7da8db4161ad8703bea1702cb0b82e
Use model_query() instead of session.query in db.instance_destroy

Unify db.instance_destroy() method to use model_query() as others
methods use.

Side effect we won't try to soft delete already soft deleted instance

Change-Id: I36d5bb42b16901c260ff4276e31a6aec46ffa8a4
Sync the DB2 communication error code change from olso

Closes-Bug: #1244092

oslo patch set: 3acd57c2825a8bf6660c3124f12794414622eb26

Change-Id: I62e3a6d1137d53c4aa72b18db5bd9f7e41694436
Adjust the order of notification for shelve instance

When shelve instance, if CONF.shelved_offload_time == 0, then the
notification order for shelve_instance() is as following:
1) compute.instance.shelve.start
2) compute.instance.shelve_offload.start
3) compute.instance.shelve_offload.end
4) compute.instance.shelve.end

This order is not correct, as actually before shelve_offload.start,
the instance was already reached shelve.end, so we should adjust the
order of notification for shelve instance as following:
1) compute.instance.shelve.start
2) compute.instance.shelve.end
3) compute.instance.shelve_offload.start
4) compute.instance.shelve_offload.end

Change-Id: I6e075b3f29e1c3f641ab1e459e1fbe3b05869a9a
Closes-Bug: #1248802
Improved debug ability for log message of cold migration

When cold migration failed because of nova scheduler return no
valid host, conductor only log no valid host, but did not specify
which instance failed.

This patch was specifying instance in the failure log for cold
migration.

Change-Id: Ia9e42f8f253323fb35a58e0be2a24ab043204d29
Fix some i18n issue in nova/compute/manager.py

Some exceptions in nova compute manager did not follow i18n coding
style, just fix them.

Change-Id: I9cc18c05419508232062c749c0f9740c5241469d
instance state will be stuck in unshelving when unshelve fails

When unshelve an instance, if this instance has been offloaded,
the conductor manager will involve re-schedule for the instance.
If re-schedule failed to find a target host for the unsleved
instance, then the instance will be stuck in unshelving state.

This patch fix the issue as this: If re-schedule failed to find a
target host for unshelve the instance, then conductor manager will
try to rollback the instance to unshelve state.

Change-Id: If49b2d2c9263b853c745ce25fe146ade51948123
Closes-Bug: #1248799
Merge "Bad except clauses order causes wrong text in http response"
Merge "Sync the DB2 communication error code change from olso"
Fix a tiny double quote matching in field obj model

Fix a tiny double quote matching in CIDR field type.

Change-Id: Ifa226b1fe7b2a3c337bebcc30f18cf5e401ec7b8
Merge "Use model_query() instead of session.query in db.instance_destroy"
Merge "Improved debug ability for log message of cold migration"
Merge "Adjust the order of notification for shelve instance"
Merge "Fix some i18n issue in nova/compute/manager.py"
Make object compat work with more positional args

Currently object_compat would break if there is more than one positional
argument after instance, since the instance will be passed as a keyword
argument and there will be a positional argument passed as instance,
once we get to the actual function call - a TypeError will be thrown
similar to:

    TypeError: ... got multiple values for keyword argument 'instance'

This patch makes sure that the instance (if not found in kwargs) is put
back in the args tuple.

Change-Id: I5e9085e9f1bc1502f627eb9b206376cf39d58f39
Merge "instance state will be stuck in unshelving when unshelve fails"
Merge "Fix a tiny double quote matching in field obj model"