00001 #!/usr/local/bin/python 00002 # 00003 # Copyright 2004 00004 # by 00005 # The Board of Trustees of the 00006 # Leland Stanford Junior University. 00007 # All rights reserved. 00008 # 00009 00010 00011 __facility__ = "Online" 00012 __abstract__ = "Plumber class test" 00013 __author__ = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online" 00014 __date__ = ("$Date: 2006/04/05 15:39:50 $").split(' ')[1] 00015 __version__ = "$Revision: 2.2 $" 00016 __release__ = "$Name: R04-12-00 $" 00017 __credits__ = "SLAC" 00018 00019 import LATTE.copyright_SLAC 00020 00021 from LATTE.client.gOptions import Options 00022 from LATTE.client.gCmdCli import CmdCli 00023 from LATTE.database.gLAT import GLAT 00024 from LATTE.database.gXBR import GXBRD 00025 from LATTE.database.gPlumber import Plumber 00026 00027 def test_initfabrics(): 00028 options = Options(['server', 'schema'], 00029 ['fswmsglevel'], 00030 ['initforce', 'ocsverbose', 'nocommander', 'usered']) 00031 try: 00032 options.parse() 00033 except Exception, msg: 00034 options.usage(str(msg)) 00035 return 00036 00037 cmdcli = CmdCli() 00038 cmdcli.setDebug(1) 00039 lat = GLAT(cmdcli) 00040 lat.readSchema(options.opts['schema']) 00041 00042 if options.usered is not None: 00043 lat.LCB.setFlag('UseRedundant', 1) 00044 00045 plumber = Plumber(lat, None) 00046 if options.fswmsglevel is not None: 00047 msglevel = int(options.fswmsglevel) 00048 else: 00049 msglevel = 3 00050 verbose = (options.ocsverbose != None) 00051 force = (options.initforce != None) 00052 commander = not(options.nocommander != None) 00053 00054 cmdcli.connect(options.opts['server']) 00055 plumber.initialize(msglevel, verbose, force, commander) 00056 cmdcli.disconnect() 00057 00058 if __name__ == '__main__': 00059 test_initfabrics()