aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLinus Nordberg <linus@torproject.org>2013-06-05 15:48:57 +0200
committerLinus Nordberg <linus@torproject.org>2013-06-12 17:24:15 +0200
commit19abaf8052e8a561536ec102f1c4f624d2494de6 (patch)
tree624210891c6a72a9ba27dcb36845a8f0bf6fefe2 /lib
parent8d75181d9c2a45b555f27e5126173026987ddf0d (diff)
downloadchutney-19abaf8052e8a561536ec102f1c4f624d2494de6.tar
chutney-19abaf8052e8a561536ec102f1c4f624d2494de6.tar.gz
Make chutney exit with -1 on failure.
If the function implementing the command (the verb, in argv[1]) return False, exit with -1. Else exit with 0 as before.
Diffstat (limited to 'lib')
-rw-r--r--lib/chutney/TorNet.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 3ec33b6..e79f0a8 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -673,7 +673,7 @@ def runConfigFile(verb, f):
print "Error: I don't know how to %s." % verb
return
- getattr(network,verb)()
+ return getattr(network,verb)()
def main():
global _BASE_ENVIRON
@@ -687,7 +687,10 @@ def main():
sys.exit(1)
f = open(sys.argv[2])
- runConfigFile(sys.argv[1], f)
+ result = runConfigFile(sys.argv[1], f)
+ if result is False:
+ return -1
+ return 0
if __name__ == '__main__':
- main()
+ sys.exit(main())