diff options
author | bst-marge-bot <marge-bot@buildstream.build> | 2019-06-27 13:17:55 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-06-27 13:17:55 +0000 |
commit | 248786e481bed8dc4c21f70ce42b29f520bee770 (patch) | |
tree | e0ff08bd98802596291eb6caedb564354d717413 | |
parent | 0ba48b73946e21470293e03ca66e68c5964715cf (diff) | |
parent | a2dcb69cb45bbaf1d63347ebd66ea21c46ee0c44 (diff) | |
download | buildstream-248786e481bed8dc4c21f70ce42b29f520bee770.tar.gz |
Merge branch 'aevri/cascache_nits' into 'master'
cascache.py: pick some nits
See merge request BuildStream/buildstream!1433
-rw-r--r-- | src/buildstream/_cas/cascache.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py index 434e71663..53f6029db 100644 --- a/src/buildstream/_cas/cascache.py +++ b/src/buildstream/_cas/cascache.py @@ -246,7 +246,7 @@ class CASCache(): raise CASCacheError("Failed to pull ref {}: {}".format(ref, e)) from e else: return False - except BlobNotFound as e: + except BlobNotFound: return False # pull_tree(): @@ -367,6 +367,9 @@ class CASCache(): # Exactly one of the two parameters has to be specified assert (path is None) != (buffer is None) + # If we're linking directly, then path must be specified. + assert (not link_directly) or (link_directly and path) + if digest is None: digest = remote_execution_pb2.Digest() @@ -400,7 +403,7 @@ class CASCache(): os.makedirs(os.path.dirname(objpath), exist_ok=True) os.link(tmp.name, objpath) - except FileExistsError as e: + except FileExistsError: # We can ignore the failed link() if the object is already in the repo. pass |