当前位置: 首页>>代码示例>>Python>>正文


Python AgentModule.am_getOption方法代码示例

本文整理汇总了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()
开发者ID:KrzysztofCiba,项目名称:DIRAC,代码行数:28,代码来源:DISETForwardingAgent.py

示例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()
开发者ID:KrzysztofCiba,项目名称:DIRAC,代码行数:25,代码来源:ZuziaAgent.py


注:本文中的DIRAC.Core.Base.AgentModule.AgentModule.am_getOption方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。