Parcourir la source

[trac547] made it exit at status code 1 when an exception is raised in the main routine

Naoki Kambe il y a 14 ans
Parent
commit
99c44efcd6
1 fichiers modifiés avec 5 ajouts et 5 suppressions
  1. 5 5
      src/bin/stats/stats_httpd.py.in

+ 5 - 5
src/bin/stats/stats_httpd.py.in

@@ -471,11 +471,11 @@ if __name__ == "__main__":
         stats_httpd = StatsHttpd(verbose=options.verbose)
         stats_httpd.start()
     except OptionValueError:
-        sys.stderr.write("[b10-stats-httpd] Error parsing options\n")
+        sys.exit("[b10-stats-httpd] Error parsing options")
     except isc.cc.session.SessionError as se:
-        sys.stderr.write("[b10-stats-httpd] Error creating module, "
-                         + "is the command channel daemon running?\n")
+        sys.exit("[b10-stats-httpd] Error creating module, "
+                 + "is the command channel daemon running?")
     except HttpServerError as hse:
-        sys.stderr.write("[b10-stats-httpd] %s\n" % hse)
+        sys.exit("[b10-stats-httpd] %s" % hse)
     except KeyboardInterrupt as kie:
-        sys.stderr.write("[b10-stats-httpd] Interrupted, exiting\n")
+        sys.exit("[b10-stats-httpd] Interrupted, exiting\n")