X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=pcubad.py;fp=pcubad.py;h=c2886f519b7e5b1a0137c1b50ad13a0480d50f22;hb=c3f2afdc81c6711c3825c82e2cd4970671575438;hp=fbcdb1714457168a0e2139007ebbf7a1297bb87c;hpb=4b1825d8577cfd0266d8c4ac2254a96407e06112;p=monitor.git diff --git a/pcubad.py b/pcubad.py index fbcdb17..c2886f5 100755 --- a/pcubad.py +++ b/pcubad.py @@ -12,6 +12,8 @@ import comon import threadpool import syncplcdb from nodequery import verify,query_to_dict,node_select +import parser as parsermodule +from nodecommon import * import plc api = plc.getAuthAPI() @@ -134,9 +136,7 @@ def collectStatusAndState(pcuname, l_plcpcus): return True if __name__ == '__main__': - from config import config - from optparse import OptionParser - parser = OptionParser() + parser = parsermodule.getParser() parser.set_defaults(filename=None, pcu=None, pcuselect=False, pcugroup=None, increment=False, dbname="pcubad", cachepcus=False) parser.add_option("", "--pcu", dest="pcu", metavar="hostname", @@ -148,8 +148,7 @@ if __name__ == '__main__': help="Specify the name of the database to which the information is saved") parser.add_option("-i", "--increment", action="store_true", dest="increment", help="Increment round number to force refresh or retry") - config = config(parser) - config.parse_args() + config = parsermodule.parse_args(parser) try: main(config)