Exemple #1
0
 def download_url(cls, package_name, digest):
     blobpath = cls.upload_url(digest)
     locations = model.get_blob_locations(digest)
     if not locations:
         raise_package_not_found(package_name, digest)
     return storage.get_direct_download_url(locations, blobpath,
                                            get_request_ip())
Exemple #2
0
    def _fetch_b64blob(cls, package_name, digest):
        blobpath = cls.upload_url(digest)
        if blobpath is None:
            raise_package_not_found(package_name, digest)

        locations = model.get_blob_locations(digest)
        if not locations:
            raise_package_not_found(package_name, digest)
        return base64.b64encode(storage.get_content(locations, blobpath))