cas | 9 +--------
lib/cas/utilities.py | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 8 deletions(-)
New commits:
commit 78162295c6852f938b03bef73bba02133cb9aa70
Author: Adam Stokes <adam(a)conans.battleaxe>
Date: Wed Oct 29 21:10:51 2008 -0400
build out crash file to use the -i switch for a more automated approach.
this gets rid of the need for expect, however, i may need to use some sort of
distributed control system like func in order to process the cores depending
on the architecture type.
diff --git a/cas b/cas
index 620238c..95f1e11 100755
--- a/cas
+++ b/cas
@@ -96,14 +96,7 @@ class CasApplication(object):
filter=filterString,
return_results=False)
- crash_cmd = "#!/bin/sh\ncrash %s %s\n" %
(os.path.join(self.storagePath,
- debugKernel),
- corefile)
- crash_exe = os.path.join(self.storagePath,"crash")
- fh = open(crash_exe,"w")
- fh.write(crash_cmd)
- fh.close()
- self.tool.make_exe(crash_exe)
+ self.tool.buildCrashFile(self.storagePath, vmcore, debugKernel)
print("Job on %s complete and located in %s." %
(self.filename,self.storagePath))
return
diff --git a/lib/cas/utilities.py b/lib/cas/utilities.py
index a9bea61..fea79d6 100755
--- a/lib/cas/utilities.py
+++ b/lib/cas/utilities.py
@@ -169,6 +169,30 @@ class Utilities(object):
return supportArch[k]
return False
+ def buildCrashFile(self, dst, vmcore, debug, file_in="crash.in"):
+ """ build crash file with predefined debug
+ commands
+ """
+ crashInputCmds = ['bt -a > bt.out\n','sys >
sys.out\n','sys -c > sys-c.out\n',
+ 'kmem -f > kmem-f.out\n', 'log >
log.out\n',
+ 'mod > mod.out\n', 'exit']
+
+ # Build crash input file
+ crashInputPath = os.path.join(dst, file_in)
+ crashInputFH = open(crashInputPath, "w")
+ crashInFH.write(crashInputCmds)
+ crashInFH.close()
+
+ vmcorePath = os.path.join(dst, vmcore)
+ crashCmd = "#!/bin/sh\ncrash %s %s -i %s -s\n" % (vmcorePath,debug,
+ crashInputPath)
+ crashExe = os.path.join(dst,"crash")
+ fh = open(crashExe,"w")
+ fh.write(crashCmd)
+ fh.close()
+ self.make_exe(crashExe)
+ return
+
class CoreException(Exception):
pass
@@ -218,3 +242,14 @@ class CoreTool(object):
if out:
return out
raise CoreException("Unable to retrieve timestamp from: %s" % (path,))
+
+class Download(object):
+ def __init__(self, url, dst):
+ self.url = url
+ self.dst = dst
+
+ def status(self, cur_bytes, tot_bytes):
+ print("Downloaded %s of %s" % (cur_bytes, tot_bytes) + "\r")
+
+ def get(self):
+ pass
Show replies by date