本文整理汇总了Python中DIRAC.Core.Base.AgentModule.AgentModule.am_getOption方法的典型用法代码示例。如果您正苦于以下问题:Python AgentModule.am_getOption方法的具体用法?Python AgentModule.am_getOption怎么用?Python AgentModule.am_getOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.Core.Base.AgentModule.AgentModule
的用法示例。
在下文中一共展示了AgentModule.am_getOption方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initialize
# 需要导入模块: from DIRAC.Core.Base.AgentModule import AgentModule [as 别名]
# 或者: from DIRAC.Core.Base.AgentModule.AgentModule import am_getOption [as 别名]
def initialize( self ):
self.RequestDBClient = RequestClient()
backend = self.am_getOption( 'Backend', '' )
self.RequestDB = False
if backend == 'mysql':
from DIRAC.RequestManagementSystem.DB.RequestDBMySQL import RequestDBMySQL
requestDB = RequestDBMySQL()
if requestDB._connected:
self.RequestDB = requestDB
gMonitor.registerActivity( "Iteration", "Agent Loops", "DISETForwardingAgent", "Loops/min", gMonitor.OP_SUM )
gMonitor.registerActivity( "Attempted", "Request Processed", "DISETForwardingAgent", "Requests/min", gMonitor.OP_SUM )
gMonitor.registerActivity( "Successful", "Request Forward Successful", "DISETForwardingAgent", "Requests/min", gMonitor.OP_SUM )
gMonitor.registerActivity( "Failed", "Request Forward Failed", "DISETForwardingAgent", "Requests/min", gMonitor.OP_SUM )
self.local = PathFinder.getServiceURL( "RequestManagement/localURL" )
if not self.local:
self.local = AgentModule.am_getOption( self, 'localURL', '' )
if not self.local:
errStr = 'The RequestManagement/localURL option must be defined.'
gLogger.fatal( errStr )
return S_ERROR( errStr )
return S_OK()
示例2: initialize
# 需要导入模块: from DIRAC.Core.Base.AgentModule import AgentModule [as 别名]
# 或者: from DIRAC.Core.Base.AgentModule.AgentModule import am_getOption [as 别名]
def initialize(self):
self.RequestDBClient = RequestClient()
gMonitor.registerActivity("Iteration", "Agent Loops", "ZuziaAgent", "Loops/min", gMonitor.OP_SUM)
gMonitor.registerActivity("Attempted", "Request Processed", "ZuziaRAgent", "Requests/min", gMonitor.OP_SUM)
gMonitor.registerActivity("Successful", "Request Forward Successful", "ZuziaAgent", "Requests/min", gMonitor.OP_SUM)
gMonitor.registerActivity("Failed", "Request Forward Failed", "ZuziaAgent", "Requests/min", gMonitor.OP_SUM)
self.local = PathFinder.getServiceURL("RequestManagement/localURL")
if not self.local:
self.local = AgentModule.am_getOption(self,'localURL','')
if not self.local:
errStr = 'The RequestManagement/localURL option must be defined.'
gLogger.fatal(errStr)
return S_ERROR(errStr)
self.central = PathFinder.getServiceURL("RequestManagement/centralURL")
if not self.central:
errStr = 'The RequestManagement/centralURL option must be defined.'
gLogger.fatal(errStr)
return S_ERROR(errStr)
return S_OK()