process endless stdout of daemon launching
authorchengtao.liu <chengtaox.liu@intel.com>
Mon, 24 Mar 2014 07:43:42 +0000 (15:43 +0800)
committerchengtao.liu <chengtaox.liu@intel.com>
Mon, 24 Mar 2014 07:43:42 +0000 (15:43 +0800)
commodule/autoexec.py

index b5a2878..7542720 100644 (file)
@@ -45,9 +45,12 @@ def shell_command(cmd, timeout=15):
         killall(proc.pid)
         exit_code = -1
         result = []
-    else:
-        if not cmd.endswith('&'):
-            result = proc.stdout.readlines() or proc.stderr.readlines()
+    elif not cmd.endswith('&'):
+        while True:
+            line = proc.stdout.readline()
+            if not line or line.find('daemon started') >= 0:
+                break
+            result.append(line)
     return [exit_code, result]