[Notes] [Git][BuildStream/buildstream][master] 2 commits: cascache: use errno module



Title: GitLab

Tiago Gomes pushed to branch master at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • buildstream/_artifactcache/cascache.py
    ... ... @@ -25,6 +25,7 @@ import signal
    25 25
     import stat
    
    26 26
     import tempfile
    
    27 27
     import uuid
    
    28
    +import errno
    
    28 29
     from urllib.parse import urlparse
    
    29 30
     
    
    30 31
     import grpc
    
    ... ... @@ -82,7 +83,8 @@ class CASCache(ArtifactCache):
    82 83
     
    
    83 84
             tree = self.resolve_ref(ref, update_mtime=True)
    
    84 85
     
    
    85
    -        dest = os.path.join(self.extractdir, element._get_project().name, element.normal_name, tree.hash)
    
    86
    +        dest = os.path.join(self.extractdir, element._get_project().name,
    
    87
    +                            element.normal_name, tree.hash)
    
    86 88
             if os.path.isdir(dest):
    
    87 89
                 # artifact has already been extracted
    
    88 90
                 return dest
    
    ... ... @@ -100,7 +102,7 @@ class CASCache(ArtifactCache):
    100 102
                     #
    
    101 103
                     # If rename fails with these errors, another process beat
    
    102 104
                     # us to it so just ignore.
    
    103
    -                if e.errno not in [os.errno.ENOTEMPTY, os.errno.EEXIST]:
    
    105
    +                if e.errno not in [errno.ENOTEMPTY, errno.EEXIST]:
    
    104 106
                         raise ArtifactError("Failed to extract artifact for ref '{}': {}"
    
    105 107
                                             .format(ref, e)) from e
    
    106 108
     
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]