'Deletes an existing image metadata.'

@wsgi.action('os-unset_image_metadata')
def delete(self, req, id, body):

    context = req.environ['cinder.context']
    if authorize(context):
        try:
            key = body['os-unset_image_metadata']['key']
        except (KeyError, TypeError):
            msg = _('Malformed    request    body.')
            raise webob.exc.HTTPBadRequest(explanation=msg)
        if key:
            (vol, metadata) = self._get_image_metadata(context, id)
            if (key not in metadata):
                raise exception.GlanceMetadataNotFound(id=id)
            self.volume_api.delete_volume_metadata(context, vol, key, meta_type=common.METADATA_TYPES.image)
        else:
            msg = _('The    key    cannot    be    None.')
            raise webob.exc.HTTPBadRequest(explanation=msg)
        return webob.Response(status_int=http_client.OK)
