diff options
author | Adam Stokes <adam.stokes@ubuntu.com> | 2014-01-27 05:42:29 -0500 |
---|---|---|
committer | Adam Stokes <adam.stokes@ubuntu.com> | 2014-01-27 05:43:08 -0500 |
commit | ec1abc03bce003141d13fc448cfc26c831da0d39 (patch) | |
tree | 4af08f24d84bb7caa33769e4fd61bc7144e41931 | |
parent | c59877c45b0cf868a78ede66c5fe0b6df2b613d6 (diff) | |
download | sos-ec1abc03bce003141d13fc448cfc26c831da0d39.tar.gz |
Fix plugin load error due to Popen returning binary data. Other fixes listed
below
sos/plugins/anacron.py:
- add one line description during verbose output for anacron
sos/archive.py, sos/utilities.py:
- make sure to return a string after a Popen call
which initially returns binary
sos/plugins/named.py:
- Remove unused import of commands
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
-rw-r--r-- | sos/archive.py | 4 | ||||
-rw-r--r-- | sos/plugins/anacron.py | 3 | ||||
-rw-r--r-- | sos/plugins/named.py | 1 | ||||
-rw-r--r-- | sos/utilities.py | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/sos/archive.py b/sos/archive.py index 4c8cceb1..f1d4d1fb 100644 --- a/sos/archive.py +++ b/sos/archive.py @@ -255,9 +255,9 @@ class TarFileArchive(FileCacheArchive): p = Popen(command, stdout=PIPE, stderr=PIPE, bufsize=-1) stdout, stderr = p.communicate() if stdout: - log.info(stdout) + log.info(stdout.decode('utf-8')) if stderr: - log.error(stderr) + log.error(stderr.decode('utf-8')) self._suffix += suffix return self.name() except Exception as e: diff --git a/sos/plugins/anacron.py b/sos/plugins/anacron.py index 04b0dcbf..a60c85e1 100644 --- a/sos/plugins/anacron.py +++ b/sos/plugins/anacron.py @@ -17,7 +17,8 @@ from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin import os class Anacron(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): - + """ capture scheduled jobs information """ + plugin_name = 'anacron' packages = ('anacron',) diff --git a/sos/plugins/named.py b/sos/plugins/named.py index 83567ab2..e73bf42a 100644 --- a/sos/plugins/named.py +++ b/sos/plugins/named.py @@ -14,7 +14,6 @@ from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin from os.path import exists, join, normpath -import commands import pdb class Named(Plugin): diff --git a/sos/utilities.py b/sos/utilities.py index da455a15..7a8674ad 100644 --- a/sos/utilities.py +++ b/sos/utilities.py @@ -161,7 +161,7 @@ def sos_get_command_output(command, timeout=300): stdout=PIPE, stderr=STDOUT, bufsize=-1, env = cmd_env) stdout, stderr = p.communicate() - return (p.returncode, stdout, 0) + return (p.returncode, stdout.decode('utf-8'), 0) else: return (127, "", 0) |