[Notes] [Git][BuildStream/buildstream][bst-1.2] 2 commits: cascache: use errno module



Title: GitLab

Javier Jardón pushed to branch bst-1.2 at BuildStream / buildstream

Commits:

1 changed file:

Changes:

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



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