def main(argv=None): # Parameter options = libTopology.Parameter(argv) options.check() log = libTopology.logC() cfg = config([options.netcfg, options.topocfg], options) cfg.eval() db = dbCon.dbCon(options) cDB = libTopology.cacheDB(options, cfg, db, log,"/tmp/topology.db") cDB.init() ## Los gehts G = graph(cDB) G.evalSystems() topo = libTopology.myTopo(cDB,options,cfg,log) topo.create(31) cDB.bkpDat() print "Ausstieg nach topo.create(None)" sys.exit() topo.fixPositions() topo.create(None) topo.svg() cDB.bkpDat()
def eval_topo(options, db, cfg, log): #if False: if True: try: os.remove("/tmp/topology.db") except: pass cDB = libTopology.cacheDB(options, cfg, db, log, "/tmp/topology.db") else: cDB = libTopology.cacheDB(options, cfg, db, log) rDB = dbCon.dbCon(options) cDB.init() ## Los gehts G = graph(cDB, options) G.evalSystems() cDB.bkpDat() topo = libTopology.myTopo(rDB, cDB, options, cfg, log) topo.create() topo.fixPositions() cDB.bkpDat()
def create(options, rDB, cfg, log): if False: try: os.remove("/tmp/topology.db") except: pass cDB = libTopology.cacheDB(options, cfg, rDB, log, "/tmp/topology.db") else: cDB = libTopology.cacheDB(options, cfg, rDB, log) # init with true clones topology also cDB.init(True) ## Los gehts topo = libTopology.myTopo(rDB, cDB, options, cfg, log) # Create Topology topo.create(options.graph) topo.svg()