[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Properly set exit code when doing oonideckgen



commit 7116e88e97954b15883fb26cb0e1503b1846e07b
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Mon Jan 19 12:29:54 2015 +0100

    Properly set exit code when doing oonideckgen
    (patch by Lunar^)
---
 bin/oonideckgen |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/bin/oonideckgen b/bin/oonideckgen
index 74ea8de..017a5d8 100755
--- a/bin/oonideckgen
+++ b/bin/oonideckgen
@@ -11,14 +11,23 @@ from twisted.internet import defer, reactor
 from ooni.utils import log
 from ooni.deckgen import cli
 
+exitCode = 128
 def failed(failure):
+    global exitCode
+
     r = failure.trap(exceptions.SystemExit)
     if r != exceptions.SystemExit:
         log.err("Failed to run oonideckgen")
         log.exception(failure)
+        exitCode = 127
+    else:
+        exitCode = failure.value.code
     reactor.stop()
 
 def done(result):
+    global exitCode
+
+    exitCode = 0
     reactor.stop()
 
 def start():
@@ -28,3 +37,4 @@ def start():
 
 reactor.callWhenRunning(start)
 reactor.run()
+sys.exit(exitCode)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits