incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1368337 - /incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py
Date Thu, 02 Aug 2012 01:45:32 GMT
Author: stroucki
Date: Thu Aug  2 01:45:32 2012
New Revision: 1368337

URL: http://svn.apache.org/viewvc?rev=1368337&view=rev
Log:
qemu: replace the fork and shell and head call to get system memory with a python only solution

Modified:
    incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py

Modified: incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py?rev=1368337&r1=1368336&r2=1368337&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py Thu Aug  2 01:45:32 2012
@@ -405,8 +405,10 @@ class Qemu(VmControlInterface):
 		host = Host()
 		host.id = service.id
 		host.name = socket.gethostname()
-		cmd = "head -n 1 /proc/meminfo"		
-		memoryStr = subprocess.Popen(cmd.split(), executable=cmd.split()[0], stdout=subprocess.PIPE).stdout.read().strip().split()
+		cmd = "head -n 1 /proc/meminfo"
+
+		# Linux specific
+		memoryStr = open("/proc/meminfo","r").readline().strip().split()
 		if (memoryStr[2] == "kB"):
 			# XXXstroucki should have parameter for reserved mem
 			host.memory = (int(memoryStr[1])/1024) - self.reservedMem



Mime
View raw message