Include proper Content-Type in the HTTP Headers

Nova Metadata Service was not setting the Content-Type
in the HTTP Response headers. Because of this, clients
were receiving the default Content-Type which is "text/html".
The changes done in this patch will include proper Content-Type
in the HTTP response headers.

Closes-Bug: #1243878
Change-Id: Ia65cdf8099c85f63d7f44f93835c606d679a7ab3
Use osapi_glance_link_prefix for image location header

When an image is created the location header returned is generated based
on the request url that nova-api receives.  If SSL termination happens
upstream the request url is an http request, and the location header is
wrongly generated with that.  The osapi_glance_link_prefix config option
is available for almost precisely this purpose, so let's use it.

Change-Id: I24e46ed8fc0763f9ddeec65e0d79590dd7b86bef
Closes-bug: 1298005
Remove unnecessary check for CONF.notify_on_state_change

Already checked CONF.notify_on_state_change at beginning, no
need to check it again

Change-Id: I757ff7b71bafdee9e2e6009e7489db520704c8cc
Fix bug detach volume fails with "KeyError" in EC2

Modified volume['instance_uuid'] to volume.get('instance_uuid'),
to avoid "KeyError", when detach a volume with "attaching" status.

Change-Id: Ic1aacab212c2a2026d18ef57ad9d77fdc6d86b47
Closes-Bug: #1280532
Read deleted instances during lifecycle events

This prevents us from failing to find the associated instance if
the lifecycle event happens after the instance has been deleted,
as in the case of a ... delete.

Change-Id: I819ddf8ff68edc407d7932bf43771c440f514f26
Closes-bug: #1304968
Merge "Read deleted instances during lifecycle events"
Merge "Use osapi_glance_link_prefix for image location header"
Merge "Fix bug detach volume fails with "KeyError" in EC2"
Merge "Include proper Content-Type in the HTTP Headers"
Merge "Remove unnecessary check for CONF.notify_on_state_change"