diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2013-04-18 15:52:32 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2013-04-18 15:52:32 +0100 |
commit | 374da9947427b10c1dfca92e1401e0d76871a5a2 (patch) | |
tree | 534beb6c8667b9c75ec05632645aa22ebb598e0c | |
parent | c23a3ffe7fae35df2e534c6205ee4d2ebcc0104e (diff) | |
download | sos-374da9947427b10c1dfca92e1401e0d76871a5a2.tar.gz |
Remove bogus path check in sar module
The sar module tries to check for the existence of a binary at
some exact path. Since all call outs now go through PATH this no
longer works leading to a bogus error level log message.
Remove this check and also move the accompanying check on
/var/lib/sa into a separate check_enabled method - without this
path being present there is nothing for the plug-in to collect.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/sar.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sos/plugins/sar.py b/sos/plugins/sar.py index 8bb9c37f..d07416dd 100644 --- a/sos/plugins/sar.py +++ b/sos/plugins/sar.py @@ -23,21 +23,16 @@ class sar(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): sarcmd='sar' files = (sapath, sarcmd) - def setup(self): + def check_enabled(self): # check to see if we are force-enabled with no sar installation if not os.path.exists(self.sapath) or not os.path.isdir(self.sapath): self.soslog.error( "sar directory %s does not exist or is not a directory" % self.sapath) - return - - if not os.path.exists(self.sarcmd) \ - or not os.access(self.sarcmd, os.X_OK): - self.soslog.error( - "sar command %s does not exist or is not runnable" - % self.sarcmd) - return + return False + return True + def setup(self): # catch exceptions here to avoid races try: dir_list=os.listdir(self.sapath) |