Jonathan Maw pushed to branch master at BuildStream / buildstream
Commits:
1 changed file:
Changes:
... | ... | @@ -318,7 +318,7 @@ class CASCache(ArtifactCache): |
318 | 318 |
resource_name = '/'.join(['uploads', str(uuid_), 'blobs',
|
319 | 319 |
digest.hash, str(digest.size_bytes)])
|
320 | 320 |
|
321 |
- def request_stream():
|
|
321 |
+ def request_stream(resname):
|
|
322 | 322 |
with open(self.objpath(digest), 'rb') as f:
|
323 | 323 |
assert os.fstat(f.fileno()).st_size == digest.size_bytes
|
324 | 324 |
offset = 0
|
... | ... | @@ -332,12 +332,12 @@ class CASCache(ArtifactCache): |
332 | 332 |
request.write_offset = offset
|
333 | 333 |
# max. 64 kB chunks
|
334 | 334 |
request.data = f.read(chunk_size)
|
335 |
- request.resource_name = resource_name # pylint: disable=cell-var-from-loop
|
|
335 |
+ request.resource_name = resname
|
|
336 | 336 |
request.finish_write = remaining <= 0
|
337 | 337 |
yield request
|
338 | 338 |
offset += chunk_size
|
339 | 339 |
finished = request.finish_write
|
340 |
- response = remote.bytestream.Write(request_stream())
|
|
340 |
+ response = remote.bytestream.Write(request_stream(resource_name))
|
|
341 | 341 |
|
342 | 342 |
request = buildstream_pb2.UpdateReferenceRequest()
|
343 | 343 |
request.keys.append(ref)
|