aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2019-03-25 15:55:47 +0100
committerBryn M. Reeves <bmr@redhat.com>2019-03-25 15:07:41 +0000
commitb47787fcd9e811175f939a26e4e547c2d9865015 (patch)
treef7c8af1a2159343e5ce7ccb50183021d9f6a2301
parent1383510510456c50dfa6133105c9f95e13551d83 (diff)
downloadsos-b47787fcd9e811175f939a26e4e547c2d9865015.tar.gz
[plugins] add_string_as_file to deal with empty content properly
If add_string_as_file is called with emtpy content, dont attempt to parse it but set summary to '' directly. Resolves: #1620 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index a2c9ba6c..607828f9 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -959,7 +959,7 @@ class Plugin(object):
"""Add a string to the archive as a file named `filename`"""
# Generate summary string for logging
- summary = content.splitlines()[0]
+ summary = content.splitlines()[0] if content else ''
if not isinstance(summary, six.string_types):
summary = content.decode('utf8', 'ignore')