- bail = False
- for key, value in options:
- if key == '--help':
- usage()
- elif key in ['-b', '--bail']:
- bail = True
- elif not ovs.daemon.parse_opt(key, value):
- sys.stderr.write("%s: unhandled option %s\n"
- % (ovs.util.PROGRAM_NAME, key))
- sys.exit(1)
+def handler(signum, _):
+ raise Exception("Signal handler called with %d" % signum)
+
+
+def main():
+
+ signal.signal(signal.SIGHUP, handler)
+
+ parser = argparse.ArgumentParser(
+ description="Open vSwitch daemonization test program for Python.")
+ parser.add_argument("-b", "--bail", action="store_true",
+ help="Exit with an error after daemonize_start().")
+
+ ovs.daemon.add_args(parser)
+ args = parser.parse_args()
+ ovs.daemon.handle_args(args)