diff options
-rw-r--r-- | buildstream/_artifactcache/cascache.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py index 2a40de773..6030fda41 100644 --- a/buildstream/_artifactcache/cascache.py +++ b/buildstream/_artifactcache/cascache.py @@ -24,6 +24,7 @@ import os import signal import stat import tempfile +import uuid import errno from urllib.parse import urlparse @@ -315,8 +316,11 @@ class CASCache(ArtifactCache): # Upload any blobs missing on the server skipped_remote = False for digest in missing_blobs.values(): + uuid_ = uuid.uuid4() + resource_name = '/'.join(['uploads', str(uuid_), 'blobs', + digest.hash, str(digest.size_bytes)]) + def request_stream(): - resource_name = os.path.join(digest.hash, str(digest.size_bytes)) with open(self.objpath(digest), 'rb') as f: assert os.fstat(f.fileno()).st_size == digest.size_bytes offset = 0 @@ -772,7 +776,7 @@ class CASCache(ArtifactCache): yield from self._required_blobs(dirnode.digest) def _fetch_blob(self, remote, digest, out): - resource_name = os.path.join(digest.hash, str(digest.size_bytes)) + resource_name = '/'.join(['blobs', digest.hash, str(digest.size_bytes)]) request = bytestream_pb2.ReadRequest() request.resource_name = resource_name request.read_offset = 0 |