Ejemplo n.º 1
0
    def _get_from_store(context, where, dest=None):
        try:
            loc = glance_store.location.get_location_from_uri(where)
            src_store = store.get_store_from_uri(where)

            if dest is not None:
                src_store.READ_CHUNKSIZE = dest.WRITE_CHUNKSIZE

            image_data, image_size = src_store.get(loc, context=context)

        except exception.NotFound as e:
            raise HTTPNotFound(explanation=e.msg)
        image_size = int(image_size) if image_size else None
        return image_data, image_size