cas | 9 +++------
lib/cas/db.py | 11 ++++++-----
lib/cas/rpmutils.py | 4 ++++
3 files changed, 13 insertions(+), 11 deletions(-)
New commits:
commit 05b30c567a8efb2c0be371b83ea6b845a90c04df
Author: adam stokes <ajs(a)redhat.com>
Date: Mon Apr 27 14:18:58 2009 -0400
- attempting to fix bug in extraction of debug kernels now
diff --git a/cas b/cas
index dcdd788..77b063c 100755
--- a/cas
+++ b/cas
@@ -171,7 +171,7 @@ class CasApplication(object):
# Add job to database, this allows us to purge
# data based on job date creation then by other
# means. (i.e. identifier == a bugzilla #)
- self.db.addJob(self.identifier, dateFormatted)
+ self.db.addJob(self.identifier, dateFormatted, self.email)
def run(self):
# setup directory structure
@@ -183,11 +183,6 @@ class CasApplication(object):
self.casLog.info("Corefile prepared, processing %s" % (corefile,))
debuginfo, debugKernel = TimestampHandler(corefile, self.casLog, self.db).run()
- # change to destination directory
- if not os.path.isdir(self.storagePath):
- os.makedirs(self.storagePath)
- os.chdir(self.storagePath)
-
corefileArch = self.util.getElfArch(corefile)
self.casLog.debug("core arch %s" % (corefileArch,))
@@ -208,6 +203,8 @@ class CasApplication(object):
else:
filterString = "*/%s" % (debugKernel,)
self.casLog.info("Extracting debug kernel with filter %s" %
(filterString,))
+ # FIXME: bug in extract where vmlinux not being placed in defined
+ # destination.
self.rpmTool.extract(debuginfo, self.storagePath,
filter=filterString,
return_results=False)
diff --git a/lib/cas/db.py b/lib/cas/db.py
index 2b7b8cc..10cf84e 100644
--- a/lib/cas/db.py
+++ b/lib/cas/db.py
@@ -38,7 +38,8 @@ class CasStorage(object):
self.cursor.execute("""create table jobs (
job_id integer primary key autoincrement,
identifier integer,
- date text)
+ date text,
+ email text)
""")
self.cursor.execute("""create table debuginfo (
debug_id integer primary key autoincrement,
@@ -107,11 +108,11 @@ class CasStorage(object):
"""
pass
- def addJob(self, identifier, date):
+ def addJob(self, identifier, date, email="noone(a)example.com"):
""" add job to db """
- values = (str(date), int(identifier))
- self.cursor.execute('''INSERT into jobs (date,identifier)
- values ("%s",%d)''' % values)
+ values = (str(date), int(identifier), str(email))
+ self.cursor.execute('''INSERT into jobs (date,identifier,email)
+ values ("%s",%d, "%s")''' % values)
self.commit()
return
diff --git a/lib/cas/rpmutils.py b/lib/cas/rpmutils.py
index 170fcf4..a35c850 100644
--- a/lib/cas/rpmutils.py
+++ b/lib/cas/rpmutils.py
@@ -40,6 +40,10 @@ class RPMBase(object):
self.cpio_args = "-imudv"
self.filter_results = []
+ if not os.path.isdir(self.dst):
+ os.makedirs(self.dst)
+ os.chdir(self.dst)
+
# pipe to handle extraction, e.g. rpm2cpio kernel.rpm | cpio -imud */vmlinux
p1 = Popen([self.rpm2cpio, self.rpm], stdout=PIPE)
p2 = Popen([self.cpio,self.cpio_args,self.filter], stdin=p1.stdout,