diff options
author | Tiago Gomes <tiago.avv@gmail.com> | 2018-08-16 15:00:12 +0000 |
---|---|---|
committer | Tiago Gomes <tiago.avv@gmail.com> | 2018-08-16 15:00:12 +0000 |
commit | 1e3e2a936d706509d4f75fa7181c9081ad6cfa40 (patch) | |
tree | 980e5c279b7efe8faadb1560da86bc859d9ad4a5 | |
parent | 898aa8a02c1d54a4d68eba25d54247bcf85d55d4 (diff) | |
parent | b62c361c427a20bc5c2e2811cd2629b012cbe5df (diff) | |
download | buildstream-1e3e2a936d706509d4f75fa7181c9081ad6cfa40.tar.gz |
Merge branch 'tiagogomes/issue-577' into 'master'
cascache: use errno module
Closes #577
See merge request BuildStream/buildstream!674
-rw-r--r-- | buildstream/_artifactcache/cascache.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py index 00d09773c..074899d81 100644 --- a/buildstream/_artifactcache/cascache.py +++ b/buildstream/_artifactcache/cascache.py @@ -25,6 +25,7 @@ import signal import stat import tempfile import uuid +import errno from urllib.parse import urlparse import grpc @@ -82,7 +83,8 @@ class CASCache(ArtifactCache): tree = self.resolve_ref(ref, update_mtime=True) - dest = os.path.join(self.extractdir, element._get_project().name, element.normal_name, tree.hash) + dest = os.path.join(self.extractdir, element._get_project().name, + element.normal_name, tree.hash) if os.path.isdir(dest): # artifact has already been extracted return dest @@ -100,7 +102,7 @@ class CASCache(ArtifactCache): # # If rename fails with these errors, another process beat # us to it so just ignore. - if e.errno not in [os.errno.ENOTEMPTY, os.errno.EEXIST]: + if e.errno not in [errno.ENOTEMPTY, errno.EEXIST]: raise ArtifactError("Failed to extract artifact for ref '{}': {}" .format(ref, e)) from e |