parser.error("Unbalanced arguments. Please check your command.") for i in range(0, len(arguments), 2): variables.append({'name': arguments[i], 'value': arguments[i + 1]}) return variables # Setup the command parser program = os.path.basename(sys.argv[0]).replace(".py", "") parser = UtilitiesParser(version=VERSION_FRM.format(program=program), description=DESCRIPTION, usage=USAGE, add_help_option=False, prog=program) # Default option to provide help information parser.add_option("--help", action="help", help="display this help message and exit") # Add --License option parser.add_option("--license", action='callback', callback=license_callback, help="display program's license and exit") # Add display width option parser.add_option("--width", action="store", dest="width", type="int", help="display width", default=PRINT_WIDTH)
logging.info("Failover console stopped with SIGTERM.") sys.exit(0) set_signal_handler(on_exit) # Setup the command parser program = os.path.basename(sys.argv[0]).replace(".py", "") parser = UtilitiesParser(version=VERSION_FRM.format(program=program), description=DESCRIPTION, usage=USAGE, add_help_option=False, prog=program) # Default option to provide help information parser.add_option("--help", action="help", help="display this help message and exit") # Add --License option parser.add_option("--license", action='callback', callback=license_callback, help="display program's license and exit") # Setup utility-specific options: add_failover_options(parser) # Interval for continuous mode parser.add_option("--interval", "-i", action="store",
for i in range(0, len(arguments), 2): variables.append({'name': arguments[i], 'value': arguments[i + 1]}) return variables # Setup the command parser program = os.path.basename(sys.argv[0]).replace(".py", "") parser = UtilitiesParser( version=VERSION_FRM.format(program=program), description=DESCRIPTION, usage=USAGE, add_help_option=False, prog=program ) # Default option to provide help information parser.add_option("--help", action="help", help="display this help message and exit") # Add --License option parser.add_option("--license", action='callback', callback=license_callback, help="display program's license and exit") # Add display width option parser.add_option("--width", action="store", dest="width", type="int", help="display width", default=PRINT_WIDTH) # Add utility directory option parser.add_option("--utildir", action="store", dest="utildir", type="string", help="location of utilities", default=UTIL_PATH)
logging.info("Failover console stopped with SIGTERM.") sys.exit(0) set_signal_handler(on_exit) # Setup the command parser program = os.path.basename(sys.argv[0]).replace(".py", "") parser = UtilitiesParser(version=VERSION_FRM.format(program=program), description=DESCRIPTION, usage=USAGE, add_help_option=False, prog=program) # Default option to provide help information parser.add_option("--help", action="help", help="display this help message and exit") # Add --License option parser.add_option("--license", action='callback', callback=license_callback, help="display program's license and exit") # Setup utility-specific options: add_failover_options(parser) # Interval for continuous mode parser.add_option("--interval", "-i", action="store",
sys.exit(0) set_signal_handler(on_exit) # Setup the command parser program = os.path.basename(sys.argv[0]).replace(".py", "") parser = UtilitiesParser( version=VERSION_FRM.format(program=program), description=DESCRIPTION, usage=USAGE, add_help_option=False, prog=program ) # Default option to provide help information parser.add_option("--help", action="help", help="display this help message and exit") # Add --License option parser.add_option("--license", action='callback', callback=license_callback, help="display program's license and exit") # Setup utility-specific options: add_failover_options(parser) # Interval for continuous mode parser.add_option("--interval", "-i", action="store", dest="interval", type="int", default="15", help="interval in seconds for polling the master for " "failure and reporting health. Default = 15 " "seconds. Lowest value is 5 seconds.")