aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/archive.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/sos/archive.py b/sos/archive.py
index 3cca9b7c..cdc1f35e 100644
--- a/sos/archive.py
+++ b/sos/archive.py
@@ -118,11 +118,18 @@ class FileCacheArchive(Archive):
self._check_path(dest)
try:
shutil.copy(src, dest)
+ except IOError:
+ self.log.info("caught IO error copying %s" % src)
+ try:
shutil.copystat(src, dest)
+ except PermissionError:
+ # SELinux xattrs in /proc and /sys throw this
+ pass
+ try:
stat = os.stat(src)
os.chown(dest, stat.st_uid, stat.st_gid)
- except IOError:
- self.log.info("caught IO error copying %s" % src)
+ except Exception as e:
+ self.log.debug("caught %s setting ownership of %s" % (e,dest))
self.log.debug("added %s to FileCacheArchive %s" %
(src, self._archive_root))