diff options
author | Valentin David <valentin.david@codethink.co.uk> | 2019-01-23 11:23:23 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-01-29 05:58:17 +0000 |
commit | 1c05a09298c331696cc8e7d81474f483fbbcc04a (patch) | |
tree | 53ade5007da5a8e6f29d694d70168fab027ef171 /buildstream | |
parent | 2fcb4491312d6f57a269449c1a50d3f18bf4cb19 (diff) | |
download | buildstream-1c05a09298c331696cc8e7d81474f483fbbcc04a.tar.gz |
Fix type of error codes in CAS server
Fixes #882.
Diffstat (limited to 'buildstream')
-rw-r--r-- | buildstream/_cas/casserver.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/buildstream/_cas/casserver.py b/buildstream/_cas/casserver.py index 2dd30a367..5482dae86 100644 --- a/buildstream/_cas/casserver.py +++ b/buildstream/_cas/casserver.py @@ -324,7 +324,7 @@ class _ContentAddressableStorageServicer(remote_execution_pb2_grpc.ContentAddres blob_response.digest.size_bytes = digest.size_bytes if len(blob_request.data) != digest.size_bytes: - blob_response.status.code = grpc.StatusCode.FAILED_PRECONDITION + blob_response.status.code = code_pb2.FAILED_PRECONDITION continue try: @@ -335,10 +335,10 @@ class _ContentAddressableStorageServicer(remote_execution_pb2_grpc.ContentAddres out.flush() server_digest = self.cas.add_object(path=out.name) if server_digest.hash != digest.hash: - blob_response.status.code = grpc.StatusCode.FAILED_PRECONDITION + blob_response.status.code = code_pb2.FAILED_PRECONDITION except ArtifactTooLargeException: - blob_response.status.code = grpc.StatusCode.RESOURCE_EXHAUSTED + blob_response.status.code = code_pb2.RESOURCE_EXHAUSTED return response |