def preInitialization(self): if not hasattr(self.config.PilotMonitorComponent, "pilotMonitorHandler"): self.config.PilotMonitorComponent.pilotMonitorHandler = \ 'PilotMonitor.Handler.PilotMonitorHandler' factory = WMFactory("PilotMonitor"); self.messages["MonitorPilots"] = factory.loadObject(\ self.config.PilotMonitorComponent.pilotMonitorHandler, self) tqconfig = Configuration.loadConfigurationFile( \ self.config.PilotMonitorComponent.TQConfig ) myThread = threading.currentThread() self.logger = myThread.logger self.logger.debug( tqconfig) self.tqStateApi = TQStateApi(self.logger, tqconfig, None)
siteThr, siteValue, taskPacks ) return result except: self.logger.debug(sys.exc_info()[0]) self.logger.debug(sys.exc_info()[1]) return {'Error':'ERROR'} registerMonitor(PilotBlSimpleMonitor, PilotBlSimpleMonitor.__name__) #for testing purpose if __name__ == '__main__': args = {'cpCmd':'rfcp','rfioSer':''} from WMCore import Configuration tqconfig = Configuration.loadConfigurationFile( \ "/data/khawar/antonio/tqcode/extras/WMCore-conf.py" ) from TQComp.Apis.TQStateApi import TQStateApi myThread = threading.currentThread() logger = logging.getLogger() #self.logger.debug( tqconfig) tqStateApi = TQStateApi(logger, tqconfig, None) pbsched = PilotBlSimpleMonitor() pbsched.monitorAll(tqStateApi) #pbsched('srm-cms.cern.ch') #poller = PABossLitePoll() #poller('abc.it.fr') #pbsched.getGroups(None)