Browse Source

Redirecting stderr to /dev/null.

pakunoda 12 years ago
parent
commit
c57beee6f6
1 changed files with 8 additions and 1 deletions
  1. 8 1
      unfiltered/setup_unfiltered.py

+ 8 - 1
unfiltered/setup_unfiltered.py

@@ -8,9 +8,16 @@ def start(args):
   setup_util.replace_text("unfiltered/src/main/resources/application.conf", "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306")
   setup_util.replace_text("unfiltered/src/main/resources/application.conf", "maxThreads = \\d+", "maxThreads = " + str(args.max_threads))
 
+  # Shamelessly stolen from stack overflow
+  try:
+    from subprocess import DEVNULL
+  except ImportError:
+    import os
+    DEVNULL = open(os.devnull, 'wb')
+
   subprocess.check_call("chmod u+x sbt", shell=True, cwd="unfiltered")
   subprocess.check_call("./sbt assembly", shell=True, cwd="unfiltered")
-  subprocess.Popen("java -jar bench-assembly-1.0.0.jar", shell=True, cwd="unfiltered/target/scala-2.10")
+  subprocess.Popen("java -jar bench-assembly-1.0.0.jar", stderr=DEVNULL, shell=True, cwd="unfiltered/target/scala-2.10")
 
   return 0
 def stop():