diff options
author | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2018-08-20 16:31:41 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-08-23 13:05:31 +0200 |
commit | d9a97c332ccb55ff99ed887fc6e755371a4c5b13 (patch) | |
tree | 4896c5bec16119f22e8baa0c4496a437b440e970 | |
parent | 037b8dd46d8b7fabf86da34f7488c6d368573cde (diff) | |
download | buildstream-juerg/cas-1.2.tar.gz |
CASCache: Fix cell-var-from-loop linting errorjuerg/cas-1.2
-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 6030fda41..c6402717c 100644 --- a/buildstream/_artifactcache/cascache.py +++ b/buildstream/_artifactcache/cascache.py @@ -320,7 +320,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 @@ -334,12 +334,12 @@ class CASCache(ArtifactCache): request.write_offset = offset # max. 64 kB chunks request.data = f.read(chunk_size) - request.resource_name = resource_name # pylint: disable=cell-var-from-loop + 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) |