diff options
author | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2018-08-20 16:31:41 +0100 |
---|---|---|
committer | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2018-08-20 16:31:43 +0100 |
commit | 5013b5f46b73b82d43cbb21f0a0a082fce7a73ad (patch) | |
tree | 7082f3ffa3a301bd47423a3db251375e562215c2 | |
parent | 372abed5f1b2202435d553b28fa807a913f8b5b9 (diff) | |
download | buildstream-jonathan/cascache-cell-var-from-loop.tar.gz |
CASCache: Fix cell-var-from-loop linting errorjonathan/cascache-cell-var-from-loop
-rw-r--r-- | buildstream/_artifactcache/cascache.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py index 074899d81..a414ba740 100644 --- a/buildstream/_artifactcache/cascache.py +++ b/buildstream/_artifactcache/cascache.py @@ -316,7 +316,7 @@ class CASCache(ArtifactCache): resource_name = '/'.join(['uploads', str(uuid_), 'blobs', digest.hash, str(digest.size_bytes)]) - def request_stream(): + def request_stream(resname): with open(self.objpath(digest), 'rb') as f: assert os.fstat(f.fileno()).st_size == digest.size_bytes offset = 0 @@ -330,12 +330,12 @@ class CASCache(ArtifactCache): request.write_offset = offset # max. 64 kB chunks request.data = f.read(chunk_size) - request.resource_name = resource_name + request.resource_name = resname request.finish_write = remaining <= 0 yield request offset += chunk_size finished = request.finish_write - response = remote.bytestream.Write(request_stream()) + response = remote.bytestream.Write(request_stream(resource_name)) request = buildstream_pb2.UpdateReferenceRequest() request.keys.append(ref) |