aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorshnavid <shnavid@ef72aa8b-4018-0410-8976-d6e080ef94d8>2007-06-15 15:26:56 +0000
committershnavid <shnavid@ef72aa8b-4018-0410-8976-d6e080ef94d8>2007-06-15 15:26:56 +0000
commit8d261721cc38aa0dbd4077ea6acd95f554f30e01 (patch)
treefa584dcddc090450e0a5e840186c6a656dee3cf0 /src
parent7d14d80a5171384064baec59f39dd71ae0111ce7 (diff)
downloadsos-8d261721cc38aa0dbd4077ea6acd95f554f30e01.tar.gz
* [BZ#241282] initial port to RHEL4 :) sos core now runs happily, plugins will probably need to be fixed as well.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@147 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rwxr-xr-xsrc/sosreport31
2 files changed, 24 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 824b236e..92947fd9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2007-06-15 Navid Sheikhol-Eslami <navid@redhat.com>
+
+ * [BZ#241282] initial port to RHEL4 :) sos core now runs happily, plugins will probably need to be fixed as well.
+ * Initial commit of XML reporting to gather details about commands executed and files gathered.
+ * Exceptions in plugin.analyse() were not catched allowing a bad plugin to break sosreport.
+
2007-06-15 Eugene Teo <eteo@redhat.com>
* lib/sos/plugins/apache.py, lib/sos/plugins/nfsserver.py, lib/sos/plugins/selinux.py, lib/sos/plugins/xinetd.py, lib/sos/plugins/ssh.py, lib/sos/plugins/sendmail.py, lib/sos/plugins/samba.py, lib/sos/plugins/named.py, lib/sos/plugins/cluster.py:
diff --git a/src/sosreport b/src/sosreport
index 62f07a75..3d640572 100755
--- a/src/sosreport
+++ b/src/sosreport
@@ -87,12 +87,12 @@ class SosOption (Option):
ACTIONS = Option.ACTIONS + ("extend",)
STORE_ACTIONS = Option.STORE_ACTIONS + ("extend",)
TYPED_ACTIONS = Option.TYPED_ACTIONS + ("extend",)
- ALWAYS_TYPED_ACTIONS = Option.ALWAYS_TYPED_ACTIONS + ("extend",)
def take_action(self, action, dest, opt, value, values, parser):
if action == "extend":
- lvalue = value.split(",")
- values.ensure_value(dest, []).extend(lvalue)
+ try: lvalue = value.split(",")
+ except: pass
+ else: values.ensure_value(dest, []).extend(lvalue)
else:
Option.take_action(self, action, dest, opt, value, values, parser)
@@ -110,10 +110,10 @@ __cmdParser__.add_option("-l", "--list-plugins", action="store_true", \
dest="listPlugins", default=False, \
help="list existing plugins")
__cmdParser__.add_option("-n", "--noplugin", action="extend", \
- dest="noplugins",\
+ dest="noplugins", type="string", \
help="list of plugins _not_ to load")
__cmdParser__.add_option("-o", "--onlyplugin", action="extend", \
- dest="onlyplugins",\
+ dest="onlyplugins", type="string", \
help="list of plugins to load")
__cmdParser__.add_option("-v", "--verbose", action="count", \
dest="verbosity", \
@@ -325,27 +325,32 @@ def sosreport():
os.mkdir(logdir, 0755)
os.mkdir(rptdir, 0755)
- # open log file
- logging.basicConfig(level=logging.DEBUG,
- format='%(asctime)s %(levelname)s: %(message)s',
- filename=logdir + "/sos.log",
- filemode='w')
+ # initialize logging
+ soslog = logging.getLogger('sos')
+ soslog.setLevel(logging.DEBUG)
+
+ # log to a file
+ flog = logging.FileHandler(logdir + "/sos.log")
+ flog.setFormatter(logging.Formatter('%(asctime)s %(levelname)s: %(message)s'))
+ flog.setLevel(logging.DEBUG)
+ soslog.addHandler(flog)
+
# define a Handler which writes INFO messages or higher to the sys.stderr
- console = logging.StreamHandler()
+ console = logging.StreamHandler(sys.stderr)
if __cmdLineOpts__.verbosity > 0:
console.setLevel(20 - __cmdLineOpts__.verbosity)
__cmdLineOpts__.progressbar = False
else:
console.setLevel(logging.INFO)
console.setFormatter(logging.Formatter('%(message)s'))
- logging.getLogger('').addHandler(console)
+ soslog.addHandler(console)
+
logging.VERBOSE = logging.INFO - 1
logging.VERBOSE2 = logging.INFO - 2
logging.VERBOSE3 = logging.INFO - 3
logging.addLevelName(logging.VERBOSE, "verbose")
logging.addLevelName(logging.VERBOSE2,"verbose2")
logging.addLevelName(logging.VERBOSE3,"verbose3")
- soslog = logging.getLogger('')
xmlrep = XmlReport()