Change HTTPUnprocessableEntity to HTTPBadRequest

Change HTTPUnprocessableEntity to HTTPBadRequest, and use the
parameter 'explanation' in place of'detail' to show the correct
error message.
This patch fixes this bug.

Change-Id: I6dc2cbe29f24634138ba4c5255b0edd7b8ad6b0e
Closes-Bug: #1283876
_translate_from_glance() can cause an unnecessary HTTP request

After returning from a get() call to python-glanceclient, nova runs a
translation function on the returned Image to get the data it wants. Part of
this process is checking for an expected set of attributes, one of which is
the deletion time ('deleted_at'). However, if the image has not been deleted,
deleted_at key will not exist. This forces another call to glance to occur for
the same image. A similar problem exists for the checksum attribute, which does
not exist before an image is active. The fix here is to only consider
deleted_at and checksum if they are expected to be present.

Change-Id: I67b7dd16a94fe60d873c012f6bd246ab24500d5a
Closes-Bug: #1275173
Change NotFound to InstanceNotFound in server_diagnostics.py

According to the get() method in nova/compute/api.py,
the index() method in nova/api/openstack/compute/
contrib/server_diagnostics.py should catch the
InstanceNotFound, rather than the NotFound.
This patch just applies to V2 API, V3 API is already
catching InstanceNotFound.

Change-Id: I9e021837b9050dade9af4725a0712f260eac6f7a
Closes-bug: #1296662
Merge "Change HTTPUnprocessableEntity to HTTPBadRequest"
Merge "Change NotFound to InstanceNotFound in server_diagnostics.py"
Merge "_translate_from_glance() can cause an unnecessary HTTP request"
Merge commit 'refs/changes/38/84138/2' of git://gold.eng.hq.xensource.com/git/github/openstack/nova into tmpbranch