diff options
author | Valentin David <valentin.david@codethink.co.uk> | 2018-11-15 12:45:13 +0100 |
---|---|---|
committer | Valentin David <valentin.david@codethink.co.uk> | 2018-11-28 15:29:52 +0100 |
commit | 227fa26d8991936d22d3b810c6a8b0bead703eb9 (patch) | |
tree | dc35bb9970339969f5a8a1456331abe47793f5fb | |
parent | 58ca298ffd5e9d4f63af51223d3b6dc40826072b (diff) | |
download | buildstream-227fa26d8991936d22d3b810c6a8b0bead703eb9.tar.gz |
Fix type error in RPC messages
-rw-r--r-- | buildstream/_artifactcache/casserver.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/buildstream/_artifactcache/casserver.py b/buildstream/_artifactcache/casserver.py index 88cbf304e..f7dc89581 100644 --- a/buildstream/_artifactcache/casserver.py +++ b/buildstream/_artifactcache/casserver.py @@ -31,6 +31,7 @@ import grpc from .._protos.build.bazel.remote.execution.v2 import remote_execution_pb2, remote_execution_pb2_grpc from .._protos.google.bytestream import bytestream_pb2, bytestream_pb2_grpc from .._protos.buildstream.v2 import buildstream_pb2, buildstream_pb2_grpc +from .._protos.google.rpc import code_pb2 from .._exceptions import CASError @@ -250,12 +251,12 @@ class _ContentAddressableStorageServicer(remote_execution_pb2_grpc.ContentAddres try: with open(self.cas.objpath(digest), 'rb') as f: if os.fstat(f.fileno()).st_size != digest.size_bytes: - blob_response.status.code = grpc.StatusCode.NOT_FOUND + blob_response.status.code = code_pb2.NOT_FOUND continue blob_response.data = f.read(digest.size_bytes) except FileNotFoundError: - blob_response.status.code = grpc.StatusCode.NOT_FOUND + blob_response.status.code = code_pb2.NOT_FOUND return response |