cas | 16 +++++++++-------
cas.conf | 6 ++++--
lib/cas/util.py | 10 ++++++----
version | 2 +-
4 files changed, 20 insertions(+), 14 deletions(-)
New commits:
commit aea790393f682d24689d4eaf1016b831df8ca17c
Author: Adam Stokes <ajs(a)redhat.com>
Date: Tue Dec 16 07:10:05 2008 -0500
- some initial tests of extracting the compressed core
were successful in detecting the core.
- fixed an issue with running cas against a core outside
of `cwd` were not being moved to work directory.
diff --git a/cas b/cas
index 89cfc1e..3d63000 100755
--- a/cas
+++ b/cas
@@ -59,11 +59,12 @@ class CoreHandler(object):
self.casLog.debug("Unable to find file %s" % (self.filename,))
sys.exit(1)
if self.tool.isCorefile(self.filename):
+ basename = os.path.basename(self.filename)
# No need to proceed to extracting corefile since we assume
# this is already at the proper stage.
shutil.move(self.filename,
- os.path.join(self.dst, self.filename))
- self.filename = os.path.join(self.dst, self.filename)
+ os.path.join(self.dst, basename))
+ self.filename = os.path.join(self.dst, basename)
return self.filename
try:
self.casLog.info("Detected a compressed core, extracting.. please wait
as " \
@@ -174,13 +175,14 @@ class CasApplication(object):
serverList = self.util.load(SERVERS)
if serverList.has_key(debugKernelArch):
# TODO: Randomize server selection
+ # TODO: Verify remote server is reachable
casProcessMachine = serverList[debugKernelArch][0]
self.casLog.info("Machine %s found, processing crash
output" % (casProcessMachine,))
cmd = os.path.join(self.storagePath,"crash")
client = fc.Overlord(casProcessMachine)
- client_dict = client.command.run(cmd)
+ clientDict = client.command.run(cmd)
# Only necessary for debugging why running of crash failed.
- # (sts, out, err) = client_dict[client_dict.keys()[0]]
+ # (sts, out, err) = clientDict[clientDict.keys()[0]]
else:
self.casLog.info("No servers available for arch and current
system not "\
"suitable for processing, please run cas-admin -h
" \
@@ -227,13 +229,13 @@ class CasApplication(object):
# for name or service not known :(
mailServer = smtplib.SMTP(SMTPHOST)
except:
- dprint("Unable to connect to mail server: %s, no email " \
- "results sent." % (SMTPHOST,))
+ self.casLog.debug("Unable to connect to mail server: %s, no
email " \
+ "results sent." % (SMTPHOST,))
mailServer.set_debuglevel(0)
mailServer.sendmail(self.email,self.email,msg)
mailServer.quit()
except smtplib.SMTPException, e:
- dprint(e)
+ self.casLog.debug(e)
self.casLog.info("Job on %s complete and located in %s." %
(self.filename,
self.storagePath))
return
diff --git a/cas.conf b/cas.conf
index 774b4f6..5a49447 100644
--- a/cas.conf
+++ b/cas.conf
@@ -12,8 +12,10 @@ rpms=/var/db/cas/rpms.db
rpmFilter=.*kernel-debuginfo-[0-9].*\.rpm
# Define where to store necessary debug information
-# NOTE: This is more than likely going to be temporary storage
-# so you could essentially set this to /tmp if space permitted
+# NOTE: This is a temporary storage area for when
+# cpio is run against an rpm and extract the debug kernel
+# for a small amount of time. This could be something like
+# /tmp if space permitted
debugs=/cores/debugs
# debug level (DEBUG, INFO)
diff --git a/lib/cas/util.py b/lib/cas/util.py
index 59cb65f..5617771 100755
--- a/lib/cas/util.py
+++ b/lib/cas/util.py
@@ -23,6 +23,7 @@ from subprocess import Popen, PIPE, call
class Logging(object):
def __init__(self, dst, logger_id, debug_level='DEBUG'):
+ self.debug_level = debug_level
self.dst = dst
self.logger_id = logger_id
self.logfile = logger_id+".log"
@@ -39,12 +40,13 @@ class Logging(object):
fh_fmt = logging.Formatter("%(asctime)s %(process)d (%(levelname)s)\t:
%(message)s")
ch.setFormatter(ch_fmt)
fh.setFormatter(fh_fmt)
- logging_level = {'DEBUG':logging.DEBUG,
- 'INFO':logging.INFO}
- self.log.setLevel(logging_level[debug_level])
+ logging_level = {'DEBUG': logging.DEBUG,
+ 'INFO' : logging.INFO}
+ self.log.setLevel(logging_level[self.debug_level])
def debug(self, msg):
- self.log.debug("[.cas.][debug] :: %s" % (msg,))
+ if self.debug_level == 'DEBUG':
+ self.log.debug("[.cas.][debug] :: %s" % (msg,))
def status(self, msg):
""" function to print status messages
diff --git a/version b/version
index a0881bd..f4a3dd4 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-0.13 103
+0.13 104