diff options
author | Jürg Billeter <j@bitron.ch> | 2019-07-10 10:31:28 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-08-20 08:09:52 +0200 |
commit | 2865dc544524f8fc8e251ade0376bf518392770b (patch) | |
tree | c576b3952d4d3f2617d8bc2495984a6255cac384 | |
parent | dac43a80346576e957657d53fa215d0e358cd7ac (diff) | |
download | buildstream-2865dc544524f8fc8e251ade0376bf518392770b.tar.gz |
cascache.py: Add instance_name parameter to add_object()
-rw-r--r-- | src/buildstream/_cas/cascache.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py index 3cb4ba87b..71040c5ea 100644 --- a/src/buildstream/_cas/cascache.py +++ b/src/buildstream/_cas/cascache.py @@ -434,13 +434,14 @@ class CASCache(): # path (str): Path to file to add # buffer (bytes): Byte buffer to add # link_directly (bool): Whether file given by path can be linked + # instance_name (str): casd instance_name for remote CAS # # Returns: # (Digest): The digest of the added object # # Either `path` or `buffer` must be passed, but not both. # - def add_object(self, *, digest=None, path=None, buffer=None, link_directly=False): + def add_object(self, *, digest=None, path=None, buffer=None, link_directly=False, instance_name=None): # Exactly one of the two parameters has to be specified assert (path is None) != (buffer is None) @@ -458,6 +459,9 @@ class CASCache(): path = tmp.name request = local_cas_pb2.CaptureFilesRequest() + if instance_name: + request.instance_name = instance_name + request.path.append(path) local_cas = self._get_local_cas() |