diff options
author | Filip Krska <fkrska@redhat.com> | 2019-03-18 18:52:27 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2019-03-18 18:54:23 +0000 |
commit | 42205ddf2f84ad27fecaf5e5f0a66cd445eb0400 (patch) | |
tree | 5fbf86918bd3f182297bec3bdfed8e09cf392af4 | |
parent | d4748e742f5c812c29d944dc75e7d9da51a7fe36 (diff) | |
download | sos-42205ddf2f84ad27fecaf5e5f0a66cd445eb0400.tar.gz |
[sosreport] use mode='w' when writing plugin exceptions
Use append mode when writing to plugin exception files: otherwise,
if multiple exceptions occur within one plugin (e.g. in separate
execution phases), the later ones will overwrite the earlier.
Resolves: #1461
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/sosreport.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py index 6470b93c..0d87ba95 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -979,7 +979,7 @@ class SoSReport(object): logpath = os.path.join(self.logdir, plugin_err_log) self.soslog.error('%s "%s.%s()"' % (msg, plugin, method)) self.soslog.error('writing traceback to %s' % logpath) - self.archive.add_string("%s\n" % trace, logpath) + self.archive.add_string("%s\n" % trace, logpath, mode='a') def prework(self): self.policy.pre_work() |