aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhjaggars <jhjaggars@gmail.com>2012-01-10 08:19:47 -0800
committerjhjaggars <jhjaggars@gmail.com>2012-01-10 08:19:47 -0800
commit6cc17fe29ea342110e627a741ef25dd3cbb7af03 (patch)
tree189d561519c0311848f8865c2d32561c619faf1c
parenta18298e82e2241a5d53405c6bd0dda99cf911594 (diff)
parent68c4d5d38ed39241b8414442a36a570324ba3531 (diff)
downloadsos-6cc17fe29ea342110e627a741ef25dd3cbb7af03.tar.gz
Merge pull request #18 from jhjaggars/master
-rw-r--r--sos/plugins/as7.py (renamed from sos/plugins/eap6.py)9
-rw-r--r--sos/plugins/nis.py29
-rw-r--r--sos/policies/__init__.py11
-rw-r--r--sos/policies/redhat.py2
4 files changed, 41 insertions, 10 deletions
diff --git a/sos/plugins/eap6.py b/sos/plugins/as7.py
index 2ac942f4..d5abea22 100644
--- a/sos/plugins/eap6.py
+++ b/sos/plugins/as7.py
@@ -34,7 +34,7 @@ class Request(object):
yield (parts.pop(0), parts.pop(0))
-class EAP6(Plugin, IndependentPlugin):
+class AS7(Plugin, IndependentPlugin):
"""JBoss related information
"""
@@ -282,12 +282,6 @@ class EAP6(Plugin, IndependentPlugin):
self.getOption("logsize"),
sub=(self.__jbossHome, 'JBOSSHOME'))
- ## Deploy dir
- deployDir = os.path.join(path, "deployments")
-
- for deployFile in find("*", deployDir, max_depth=1):
- self.addCopySpec(deployFile, sub=(self.__jbossHome, 'JBOSSHOME'))
-
def setup(self):
## We need to know where JBoss is installed and if we can't find it we
@@ -310,7 +304,6 @@ class EAP6(Plugin, IndependentPlugin):
self.__getFiles(self.__jbossServerConfigDirs)
- # FIXME: this is still not right, tweak the search paths to pick up the right files
def postproc(self):
"""
Obfuscate passwords.
diff --git a/sos/plugins/nis.py b/sos/plugins/nis.py
new file mode 100644
index 00000000..bd45e3d5
--- /dev/null
+++ b/sos/plugins/nis.py
@@ -0,0 +1,29 @@
+## nis.py
+## A plugin to gather all the NIS information
+
+### This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+from sos.plugins import Plugin, RedHatPlugin
+import os
+
+class nis(Plugin, RedHatPlugin):
+ """NIS related information
+ """
+ def checkenabled(self):
+ return os.path.exists("/var/yp")
+
+ def setup(self):
+ self.addCopySpec("/etc/yp*.conf")
+ self.addCopySpec("/var/yp/*")
diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py
index 07c75f64..a2234016 100644
--- a/sos/policies/__init__.py
+++ b/sos/policies/__init__.py
@@ -25,7 +25,7 @@ def load(cache={}):
if policy.check():
cache['policy'] = policy()
return policy()
- raise Exception("No policy could be loaded.")
+ return GenericPolicy()
class PackageManager(object):
@@ -133,6 +133,7 @@ No changes will be made to your system.
def _parse_uname(self):
(system, node, release,
version, machine, processor) = platform.uname()
+ self.system = system
self.hostname = node
self.release = release
self.smp = version.split()[1] == "SMP"
@@ -274,3 +275,11 @@ No changes will be made to your system.
text will be substituted accordingly. You can also override this
method to do something more complicated."""
return self.msg % {'distro': self.distro}
+
+
+class GenericPolicy(Policy):
+ """This Policy will be returned if no other policy can be loaded. This
+ should allow for IndependentPlugins to be executed on any system"""
+
+ def get_msg(self):
+ return self.msg % {'distro': self.system}
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py
index cfd31ef2..398514e1 100644
--- a/sos/policies/redhat.py
+++ b/sos/policies/redhat.py
@@ -98,7 +98,7 @@ class RHELPolicy(Policy):
@classmethod
def check(self):
"This method checks to see if we are running on RHEL. It returns True or False."
- return os.path.isfile('/etc/redhat-release')
+ return os.path.isfile('/etc/redhat-release') or os.path.isfile('/etc/fedora-release')
def preferedArchive(self):
from sos.utilities import TarFileArchive