aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorastokes_rhn <astokes_rhn@ef72aa8b-4018-0410-8976-d6e080ef94d8>2007-08-02 21:47:45 +0000
committerastokes_rhn <astokes_rhn@ef72aa8b-4018-0410-8976-d6e080ef94d8>2007-08-02 21:47:45 +0000
commit4052205b71b7f4e795838c7abdfd647b54db157d (patch)
tree298e277299ab175be63a755e33a1e7cd2bccca1e
parentb447a3090ded3fd359e6b8ddc8e22b6cdb83f492 (diff)
downloadsos-4052205b71b7f4e795838c7abdfd647b54db157d.tar.gz
committed autofs updates to trunk
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@319 ef72aa8b-4018-0410-8976-d6e080ef94d8
-rw-r--r--src/lib/sos/plugins/autofs.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/lib/sos/plugins/autofs.py b/src/lib/sos/plugins/autofs.py
index 60a86b53..48dd57b4 100644
--- a/src/lib/sos/plugins/autofs.py
+++ b/src/lib/sos/plugins/autofs.py
@@ -29,13 +29,10 @@ class autofs(sos.plugintools.PluginBase):
""" testing if autofs debug has been enabled anywhere
"""
# Global debugging
- f=open('/etc/sysconfig/autofs','r')
- content=f.read()
- f.close()
- reg=re.compile(r"^(DEFAULT_LOGGING|DAEMONOPTIONS)=(.*)\D",re.MULTILINE)
optlist=[]
- for opt in reg.findall(content):
- for opt2 in opt.split(" "):
+ opt = self.fileGrep(r"^(DEFAULT_LOGGING|DAEMONOPTIONS)=(.*)", "/etc/sysconfig/autofs")
+ for opt1 in opt:
+ for opt2 in opt1.split(" "):
optlist.append(opt2)
for dtest in optlist:
if dtest == "--debug" or dtest == "debug":
@@ -44,11 +41,8 @@ class autofs(sos.plugintools.PluginBase):
def getdaemondebug(self):
""" capture daemon debug output
"""
- f=open('/etc/sysconfig/autofs','r')
- content=f.read()
- f.close()
- reg=re.compile(r"^(daemon.*)\s+(\/var\/log\/.*)\D",re.MULTILINE)
- for i in reg.findall(content):
+ debugout = self.fileGrep(r"^(daemon.*)\s+(\/var\/log\/.*)", "/etc/sysconfig/autofs")
+ for i in debugout:
return i[1]
def setup(self):
@@ -61,7 +55,7 @@ class autofs(sos.plugintools.PluginBase):
self.collectExtOutput("/bin/egrep -e 'automount|pid.*nfs' /proc/mounts")
self.collectExtOutput("/bin/mount | egrep -e 'automount|pid.*nfs'")
self.collectExtOutput("/sbin/chkconfig --list autofs")
- if self.checkdebug() is True:
+ if self.checkdebug():
self.addCopySpec(self.getdaemondebug())
return