incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1363566 - /incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py
Date Thu, 19 Jul 2012 22:07:33 GMT
Author: stroucki
Date: Thu Jul 19 22:07:32 2012
New Revision: 1363566

URL: http://svn.apache.org/viewvc?rev=1363566&view=rev
Log:
qemu: Resolve deprecation warning for popen2 using http://docs.python.org/library/subprocess.html#subprocess-replacements

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=1363566&r1=1363565&r2=1363566&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py Thu Jul 19 22:07:32 2012
@@ -728,7 +728,8 @@ class Qemu(VmControlInterface):
 
 	def __checkPortListening(self, port):
 		# XXXpipe: find whether something is listening yet on the port
-		(stdin, stdout) = os.popen2("netstat -ln | grep 0.0.0.0:%d | wc -l" % (port))
+		p = subprocess.Popen("netstat -ln | grep 0.0.0.0:%d | wc -l" % (port), shell = True, stdin
= PIPE, stdout = PIPE, close_fds = True)
+		(stdin, stdout) = (p.stdin, p.stdout)
 		stdin.close()
 		r = stdout.read()
 		lc = int(r.strip())



Mime
View raw message