From 374da9947427b10c1dfca92e1401e0d76871a5a2 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Thu, 18 Apr 2013 15:52:32 +0100 Subject: 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 --- sos/plugins/sar.py | 13 ++++--------- 1 file 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) -- cgit