From 83fccfda596c2a8065f2c5ab70fda13c8602f35a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Mon, 30 Nov 2009 22:26:22 +0000 Subject: [PATCH] remove dup. code: we have a command called bootman.py, we don't need execute the module as a script. --- monitor/bootman.py | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/monitor/bootman.py b/monitor/bootman.py index b7ec58c..6bc00b3 100755 --- a/monitor/bootman.py +++ b/monitor/bootman.py @@ -825,46 +825,5 @@ def restore_basic(sitehist, hostname, config=None, forced_action=None): return bootman_action -# MAIN ------------------------------------------------------------------- - -def main(): - from monitor import parser as parsermodule - parser = parsermodule.getParser() - - parser.set_defaults(child=False, collect=False, nosetup=False, verbose=False, - force=None, quiet=False) - parser.add_option("", "--child", dest="child", action="store_true", - help="This is the child mode of this process.") - parser.add_option("", "--force", dest="force", metavar="boot_state", - help="Force a boot state passed to BootManager.py.") - parser.add_option("", "--quiet", dest="quiet", action="store_true", - help="Extra quiet output messages.") - parser.add_option("", "--verbose", dest="verbose", action="store_true", - help="Extra debug output messages.") - parser.add_option("", "--nonet", dest="nonet", action="store_true", - help="Do not setup the network, use existing log files to re-run a test pass.") - parser.add_option("", "--collect", dest="collect", action="store_true", - help="No action, just collect dmesg, and bm.log") - parser.add_option("", "--nosetup", dest="nosetup", action="store_true", - help="Do not perform the orginary setup phase.") - - parser = parsermodule.getParser(['nodesets', 'defaults'], parser) - config = parsermodule.parse_args(parser) - - if config.nodelist: - nodes = config.getListFromFile(config.nodelist) - elif config.node: - nodes = [ config.node ] - else: - parser.print_help() - sys.exit(1) - - for node in nodes: - # get sitehist - lb = plccache.plcdb_hn2lb[node] - sitehist = SiteInterface.get_or_make(loginbase=lb) - #reboot(node, config) - restore(sitehist, node, config=None, forced_action=None) - if __name__ == "__main__": - main() + print "ERROR: Can not execute module as a command! Please use commands/%s." % __file__ -- 2.43.0