cas | 5 ++++-
lib/cas/core.py | 7 ++++++-
lib/cas/util.py | 2 +-
version | 2 +-
4 files changed, 12 insertions(+), 4 deletions(-)
New commits:
commit 4948390870a0b44969bb8b0e478946b434c99327
Author: Adam Stokes <ajs(a)redhat.com>
Date: Tue Dec 16 08:58:39 2008 -0500
- trying to solve all problems that arise when running
cas against a file outside of its `cwd`. latest problem
is with a gzipped file when not being redirected to
stdout. ugly hack to address that for now
diff --git a/cas b/cas
index 3d63000..7a81329 100755
--- a/cas
+++ b/cas
@@ -49,6 +49,7 @@ class CoreHandler(object):
def run(self):
if(self.filename.startswith("http") or
self.filename.startswith("ftp")):
+ self.casLog.info("Downloading %s" % (self.filename,))
# filename is a url, process it with our download module
# this should return the the abspath to our processed directory
# and downloaded file
@@ -182,7 +183,9 @@ class CasApplication(object):
client = fc.Overlord(casProcessMachine)
clientDict = client.command.run(cmd)
# Only necessary for debugging why running of crash failed.
- # (sts, out, err) = clientDict[clientDict.keys()[0]]
+ sts, out, err = clientDict[clientDict.keys()[0]]
+ if sts:
+ self.casLog.debug(out.strip())
else:
self.casLog.info("No servers available for arch and current
system not "\
"suitable for processing, please run cas-admin -h
" \
diff --git a/lib/cas/core.py b/lib/cas/core.py
index d3cd0db..b46af47 100644
--- a/lib/cas/core.py
+++ b/lib/cas/core.py
@@ -26,7 +26,7 @@ class CoreBase(object):
"Return a good default Operation, judging by the first 300 bytes or
so."
suffix_map = { "tar" : ["tar", "xvf"],
"tgz" : ["tar", "xvzf"],
- "gz" : ["gunzip", "-q"],
+ "gz" : ["gunzip", "-qcd"],
"tbz" : ["tar", "xvjf"],
"bz2" : ["bunzip2", "-q"],
"zip" : ["unzip", "-f"]}
@@ -65,6 +65,11 @@ class CoreBase(object):
raise CoreException("Can not determine compression format.")
else:
format.append(self.filepath)
+ # if gunzip in format we need to redirect to stdout
+ # FIXME: this is stupid and ugly, gotta be a better way.
+ if 'gunzip' in format[0]:
+ format.append(">")
+ format.append(os.path.join(self.dst,"vmcore"))
# TODO: figure out someway to print some status to the screen
# during extraction
# FIXME: failing to determine corefile after extraction, running
diff --git a/lib/cas/util.py b/lib/cas/util.py
index 5617771..d17232c 100755
--- a/lib/cas/util.py
+++ b/lib/cas/util.py
@@ -169,7 +169,7 @@ class UtilBase(object):
crashInputFH.close()
vmcorePath = os.path.join(dst, vmcore)
- crashCmd = "#!/bin/sh\ncrash %s %s -i %s -s\n" % (vmcorePath, debug,
+ crashCmd = "#!/bin/sh\ncrash %s %s -s < %s\n" % (vmcorePath, debug,
crashInputPath)
crashExe = os.path.join(dst,"crash")
fh = open(crashExe,"w")
diff --git a/version b/version
index f4a3dd4..9c81921 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-0.13 104
+0.13 106
Show replies by date
This also addresses a problem when running crash from within func as
crash was reporting no tty device found. The fix was to use the
redirection as seen in the below code
diff --git a/lib/cas/util.py b/lib/cas/util.py
index 5617771..d17232c 100755
--- a/lib/cas/util.py
+++ b/lib/cas/util.py
@@ -169,7 +169,7 @@ class UtilBase(object):
crashInputFH.close()
vmcorePath = os.path.join(dst, vmcore)
- crashCmd = "#!/bin/sh\ncrash %s %s -i %s -s\n" % (vmcorePath, debug,
+ crashCmd = "#!/bin/sh\ncrash %s %s -s < %s\n" % (vmcorePath,
debug,
crashInputPath)
crashExe = os.path.join(dst,"crash")
fh = open(crashExe,"w")
--
( adam stokes ) || ( adam.stokes(a)gmail.com )