diff options
author | Pavel Moravec <pmoravec@redhat.com> | 2019-03-25 15:55:47 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2019-03-25 15:07:41 +0000 |
commit | b47787fcd9e811175f939a26e4e547c2d9865015 (patch) | |
tree | f7c8af1a2159343e5ce7ccb50183021d9f6a2301 | |
parent | 1383510510456c50dfa6133105c9f95e13551d83 (diff) | |
download | sos-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__.py | 2 |
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') |