nicer output of sfi (catches SystemExit)
Thierry Parmentelat [Tue, 21 May 2013 15:14:24 +0000 (17:14 +0200)]
clientbin/sfi.py
sfa/client/sfi.py

index bf80d59..a3b7de7 100755 (executable)
@@ -2,7 +2,8 @@
 
 # sfi -- slice-based facility interface
 
+import sys
 from sfa.client.sfi import Sfi
 
 if __name__ == "__main__":
-    Sfi().main()
+    sys.exit(Sfi().main())
index 3e632b4..21f0f8f 100644 (file)
@@ -505,11 +505,13 @@ use this if you mean an authority instead""")
 
         try:
             self.dispatch(command, command_options, command_args)
+        except SystemExit:
+            return 1
         except:
             self.logger.log_exc ("sfi command %s failed"%command)
-            sys.exit(1)
+            return 1
 
-        return
+        return 0
     
     ####################
     def read_config(self):