summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarius Makovsky <traveltissues@protonmail.com>2019-12-05 12:30:46 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-12-09 08:08:31 +0000
commit4dc30226949af87a3162adf6ed7e2c537ada4c4a (patch)
tree981e6906296a4df8454c7373fa8af712364b55a6 /src
parentdbe0b4db133899141e6b8cc7697eaf7915332685 (diff)
downloadbuildstream-4dc30226949af87a3162adf6ed7e2c537ada4c4a.tar.gz
casserver: remove _digest_from_*_resource_name()
Diffstat (limited to 'src')
-rw-r--r--src/buildstream/_cas/casserver.py45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/buildstream/_cas/casserver.py b/src/buildstream/_cas/casserver.py
index 3415ac59a..882e7e6d4 100644
--- a/src/buildstream/_cas/casserver.py
+++ b/src/buildstream/_cas/casserver.py
@@ -24,7 +24,6 @@ import logging
import os
import signal
import sys
-import uuid
import grpc
from google.protobuf.message import DecodeError
@@ -577,47 +576,3 @@ class _SourceServicer(source_pb2_grpc.SourceServiceServicer):
os.makedirs(os.path.dirname(path), exist_ok=True)
with save_file_atomic(path, "w+b") as f:
f.write(source_proto.SerializeToString())
-
-
-def _digest_from_download_resource_name(resource_name):
- parts = resource_name.split("/")
-
- # Accept requests from non-conforming BuildStream 1.1.x clients
- if len(parts) == 2:
- parts.insert(0, "blobs")
-
- if len(parts) != 3 or parts[0] != "blobs":
- return None
-
- try:
- digest = remote_execution_pb2.Digest()
- digest.hash = parts[1]
- digest.size_bytes = int(parts[2])
- return digest
- except ValueError:
- return None
-
-
-def _digest_from_upload_resource_name(resource_name):
- parts = resource_name.split("/")
-
- # Accept requests from non-conforming BuildStream 1.1.x clients
- if len(parts) == 2:
- parts.insert(0, "uploads")
- parts.insert(1, str(uuid.uuid4()))
- parts.insert(2, "blobs")
-
- if len(parts) < 5 or parts[0] != "uploads" or parts[2] != "blobs":
- return None
-
- try:
- uuid_ = uuid.UUID(hex=parts[1])
- if uuid_.version != 4:
- return None
-
- digest = remote_execution_pb2.Digest()
- digest.hash = parts[3]
- digest.size_bytes = int(parts[4])
- return digest
- except ValueError:
- return None