Browse Source

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.
Linus Nordberg 11 years ago
parent
commit
19abaf8052
1 changed files with 6 additions and 3 deletions
  1. 6 3
      lib/chutney/TorNet.py

+ 6 - 3
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())