'Get backend storage location url.
Returns a tuple containing the direct url and locations representing
the backend storage location, or (None, None) if these attributes are
not shown by Glance.'

def get_location(self, context, image_id):

    if (CONF.glance_api_version == 1):
        return (None, None)
    try:
        client = GlanceClientWrapper(version=2)
        image_meta = client.call(context, 'get', image_id)
    except Exception:
        _reraise_translated_image_exception(image_id)
    if (not self._is_image_available(context, image_meta)):
        raise exception.ImageNotFound(image_id=image_id)
    return (getattr(image_meta, 'direct_url', None), getattr(image_meta, 'locations', None))
