Browse code

Wait for command in worlddump

Wait for the command to complete and catch errors when running
commands.

Change-Id: I2c93b3bdd930ed8564e33bd2d45fe4e3f08f03f5

Ian Wienand authored on 2015/07/01 05:14:01
Showing 1 changed files
... ...
@@ -21,9 +21,9 @@ import datetime
21 21
 import fnmatch
22 22
 import os
23 23
 import os.path
24
+import subprocess
24 25
 import sys
25 26
 
26
-from subprocess import Popen
27 27
 
28 28
 def get_options():
29 29
     parser = argparse.ArgumentParser(
... ...
@@ -47,7 +47,10 @@ def _dump_cmd(cmd):
47 47
     print cmd
48 48
     print "-" * len(cmd)
49 49
     print
50
-    Popen(cmd, shell=True)
50
+    try:
51
+        subprocess.check_call(cmd, shell=True)
52
+    except subprocess.CalledProcessError:
53
+        print "*** Failed to run: %s" % cmd
51 54
 
52 55
 
53 56
 def _header(name):