'Same as get_image_meta_or_404 except that it will raise a 403 if the
image is deactivated or 404 if the image is otherwise not \'active\'.'

def get_active_image_meta_or_error(self, request, image_id):

    image = self.get_image_meta_or_404(request, image_id)
    if (image['status'] == 'deactivated'):
        LOG.debug('Image    %s    is    deactivated', image_id)
        msg = (_('Image    %s    is    deactivated') % image_id)
        raise webob.exc.HTTPForbidden(msg, request=request, content_type='text/plain')
    if (image['status'] != 'active'):
        LOG.debug('Image    %s    is    not    active', image_id)
        msg = (_('Image    %s    is    not    active') % image_id)
        raise webob.exc.HTTPNotFound(msg, request=request, content_type='text/plain')
    return image
