[Uludag-commits] r11925 - in trunk/bocek: . src
svn-uludag at uludag.org.tr
svn-uludag at uludag.org.tr
10 Oca 2007 Çar 20:47:40 EET
Author: gokmen.goksel
Date: Wed Jan 10 20:47:40 2007
New Revision: 11925
Modified:
trunk/bocek/NOTE
trunk/bocek/src/bocek.py
trunk/bocek/src/consts.py
Log:
bişiler bişiler
Modified: trunk/bocek/NOTE
=================================================================
--- trunk/bocek/NOTE (original)
+++ trunk/bocek/NOTE Wed Jan 10 20:47:40 2007
@@ -47,14 +47,6 @@
- /usr/bin/df -h
- /bin/service
- /usr/bin/uname -a
- - /usr/bin/free /usr/sbin/lspci
- - /usr/sbin/lspci -n
- - /usr/sbin/lsusb
- - /usr/bin/lsscsi -v
- - /sbin/fdisk -l
- - /usr/bin/df -h
- - /bin/service
- - /usr/bin/uname -a
- /usr/bin/free
* root hakkı gerektiren çıktılar
Modified: trunk/bocek/src/bocek.py
=================================================================
--- trunk/bocek/src/bocek.py (original)
+++ trunk/bocek/src/bocek.py Wed Jan 10 20:47:40 2007
@@ -65,16 +65,19 @@
def buildReport(self):
self.output=""
- logs = self.getCheckedLogs()
+ checkedLogs = self.getCheckedLogs()
# self.output ="From : %s (%s) at %s\n"%(lineEmail.text(),getIp,time)
self.output+="Summary : %s \n" % self.lineSummary.text()
self.output+="Details : %s \n" % self.lineDetails.text()
self.output+="\nAdditional Files : \n%s\n"%("*"*40)
- #FIX
- for log in logs:
- self.output+="\n========» %s «========\n" % logs
- self.output+=self.getStaticOutput(logs)
- self.output+="\n"#+("="*40)+"\n"
+ for logs in checkedLogs:
+ for log in logs:
+ self.output+="\n========» %s «========\n" % log
+ if logs[log]==1:
+ self.output+=self.getStaticOutput(log)
+ elif logs[log]==2:
+ self.output+=self.getCommandOutput(log)
+ self.output+="\n"#+("="*40)+"\n"
print self.writeReport()
def writeReport(self):
@@ -92,7 +95,8 @@
return arrayToStr(lines)
def getCommandOutput(self,cmd):
- return subprocess.call(cmd)
+ a = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ return arrayToStr(a.communicate())
def getCheckedLogs(self):
ret=[]
Modified: trunk/bocek/src/consts.py
=================================================================
--- trunk/bocek/src/consts.py (original)
+++ trunk/bocek/src/consts.py Wed Jan 10 20:47:40 2007
@@ -1,6 +1,6 @@
-# consts. 1:is static file, 2:is executable
+# consts. 1:is static file, 2:is command output
-standartLogs= {"/var/log/comar.log" :1,
+standartLogs= {#"/var/log/comar.log" :1,
"/var/log/user.log" :1,
"/var/log/Xorg.0.log" :1,
"/bin/dmesg" :2,
Uludag-commits mesaj listesiyle ilgili
daha fazla bilgi