Browse Source

wrap get_flags with backup_io

Marian Beermann 9 years ago
parent
commit
aade62c9f9
2 changed files with 8 additions and 5 deletions
  1. 2 3
      src/borg/archive.py
  2. 6 2
      src/borg/archiver.py

+ 2 - 3
src/borg/archive.py

@@ -657,13 +657,12 @@ Number of files: {0.stats.nfiles}'''.format(
             attrs['user'] = attrs['group'] = None
             attrs['user'] = attrs['group'] = None
         with backup_io():
         with backup_io():
             xattrs = xattr.get_all(path, follow_symlinks=False)
             xattrs = xattr.get_all(path, follow_symlinks=False)
+            bsdflags = get_flags(path, st)
+            acl_get(path, attrs, st, self.numeric_owner)
         if xattrs:
         if xattrs:
             attrs['xattrs'] = StableDict(xattrs)
             attrs['xattrs'] = StableDict(xattrs)
-        bsdflags = get_flags(path, st)
         if bsdflags:
         if bsdflags:
             attrs['bsdflags'] = bsdflags
             attrs['bsdflags'] = bsdflags
-        with backup_io():
-            acl_get(path, attrs, st, self.numeric_owner)
         return attrs
         return attrs
 
 
     def process_dir(self, path, st):
     def process_dir(self, path, st):

+ 6 - 2
src/borg/archiver.py

@@ -324,8 +324,12 @@ class Archiver:
             return
             return
         status = None
         status = None
         # Ignore if nodump flag is set
         # Ignore if nodump flag is set
-        if get_flags(path, st) & stat.UF_NODUMP:
-            self.print_file_status('x', path)
+        try:
+            if get_flags(path, st) & stat.UF_NODUMP:
+                self.print_file_status('x', path)
+                return
+        except OSError as e:
+            self.print_warning('%s: %s', path, e)
             return
             return
         if stat.S_ISREG(st.st_mode):
         if stat.S_ISREG(st.st_mode):
             if not dry_run:
             if not dry_run: