commit 19abaf8052e8a561536ec102f1c4f624d2494de6 Author: Linus Nordberg linus@torproject.org Date: Wed Jun 5 15:48:57 2013 +0200
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. --- lib/chutney/TorNet.py | 9 ++++++--- 1 file 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())