aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2014-04-16 21:06:03 +0100
committerBryn M. Reeves <bmr@redhat.com>2014-04-16 21:06:03 +0100
commit241d240a25faf1b73c0378201d32ccb88b61655c (patch)
treea771e46f28e4efc507870f20c47aba8bcdfb4b28
parent29f1927d5cc7dbe5cb959abca27b43c8ae5c1e61 (diff)
downloadsos-241d240a25faf1b73c0378201d32ccb88b61655c.tar.gz
Don't handle exceptions in do_copy_path()
Allow the main SoSReport class to handle exceptions that occur while calling a plugin's setup() and collect() methods. Partial fix for Issue #266. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/__init__.py23
1 files changed, 8 insertions, 15 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index f7339638..1570b6a9 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -303,25 +303,18 @@ class Plugin(object):
# if we get here, it's definitely a regular file (not a symlink or dir)
self.log_debug("copying file '%s' to archive:'%s'" % (srcpath,dest))
- try:
- stat = os.stat(srcpath)
- # if not readable(srcpath)
- if not (stat.st_mode & 0o444):
- # FIXME: reflect permissions in archive
- self.archive.add_string("", dest)
- else:
- self.archive.add_file(srcpath, dest)
+ stat = os.stat(srcpath)
+ # if not readable(srcpath)
+ if not (stat.st_mode & 0o444):
+ # FIXME: reflect permissions in archive
+ self.archive.add_string("", dest)
+ else:
+ self.archive.add_file(srcpath, dest)
- self.copied_files.append({'srcpath':srcpath,
+ self.copied_files.append({'srcpath':srcpath,
'dstpath':dest,
'symlink':"no"})
- except Exception as e:
- self.log_error("unable to add file '%s' to archive:'%s'"
- % (srcpath, dest))
- self.log_error(traceback.format_exc())
-
-
def add_forbidden_path(self, forbiddenPath):
"""Specify a path to not copy, even if it's part of a copy_specs[]
entry.