Loading buildstream/_artifactcache/cascache.py +5 −9 Original line number Diff line number Diff line Loading @@ -108,16 +108,12 @@ class CASCache(): checkoutdir = os.path.join(tmpdir, ref) self._checkout(checkoutdir, tree) os.makedirs(os.path.dirname(dest), exist_ok=True) try: os.rename(checkoutdir, dest) utils.move_atomic(checkoutdir, dest) except DirectoryExistsError: # Another process beat us to renamse pass except OSError as e: # With rename it's possible to get either ENOTEMPTY or EEXIST # in the case that the destination path is a not empty directory. # # If rename fails with these errors, another process beat # us to it so just ignore. if e.errno not in [errno.ENOTEMPTY, errno.EEXIST]: raise CASError("Failed to extract directory for ref '{}': {}".format(ref, e)) from e return dest Loading Loading
buildstream/_artifactcache/cascache.py +5 −9 Original line number Diff line number Diff line Loading @@ -108,16 +108,12 @@ class CASCache(): checkoutdir = os.path.join(tmpdir, ref) self._checkout(checkoutdir, tree) os.makedirs(os.path.dirname(dest), exist_ok=True) try: os.rename(checkoutdir, dest) utils.move_atomic(checkoutdir, dest) except DirectoryExistsError: # Another process beat us to renamse pass except OSError as e: # With rename it's possible to get either ENOTEMPTY or EEXIST # in the case that the destination path is a not empty directory. # # If rename fails with these errors, another process beat # us to it so just ignore. if e.errno not in [errno.ENOTEMPTY, errno.EEXIST]: raise CASError("Failed to extract directory for ref '{}': {}".format(ref, e)) from e return dest Loading