Пример #1
0
def main():
  localCfg = LocalConfiguration()
  localCfg.setUsageMessage(__doc__)

  positionalArgs = localCfg.getPositionalArguments()
  if len(positionalArgs) == 0:
    gLogger.fatal("You must specify which agent to run!")
    sys.exit(1)

  agentName = positionalArgs[0]
  localCfg.setConfigurationForAgent(agentName)
  localCfg.addMandatoryEntry("/DIRAC/Setup")
  localCfg.addDefaultEntry("/DIRAC/Security/UseServerCertificate", "yes")
  localCfg.addDefaultEntry("LogLevel", "INFO")
  localCfg.addDefaultEntry("LogColor", True)
  resultDict = localCfg.loadUserData()
  if not resultDict['OK']:
    gLogger.error("There were errors when loading configuration", resultDict['Message'])
    sys.exit(1)

  includeExtensionErrors()

  agentReactor = AgentReactor(positionalArgs[0])
  result = agentReactor.loadAgentModules(positionalArgs)
  if result['OK']:
    agentReactor.go()
  else:
    gLogger.error("Error while loading agent module", result['Message'])
    sys.exit(2)
Пример #2
0
def main():
    Script.registerArgument(["Agent: specify which agent to run"])
    positionalArgs = Script.getPositionalArgs(group=True)
    localCfg = Script.localCfg

    agentName = positionalArgs[0]
    localCfg.setConfigurationForAgent(agentName)
    localCfg.addMandatoryEntry("/DIRAC/Setup")
    localCfg.addDefaultEntry("/DIRAC/Security/UseServerCertificate", "yes")
    localCfg.addDefaultEntry("LogLevel", "INFO")
    localCfg.addDefaultEntry("LogColor", True)
    resultDict = localCfg.loadUserData()
    if not resultDict["OK"]:
        gLogger.error("There were errors when loading configuration", resultDict["Message"])
        sys.exit(1)

    includeExtensionErrors()

    agentReactor = AgentReactor(positionalArgs[0])
    result = agentReactor.loadAgentModules(positionalArgs)
    if result["OK"]:
        agentReactor.go()
    else:
        gLogger.error("Error while loading agent module", result["Message"])
        sys.exit(2)
Пример #3
0
def main():
    Script.registerArgument(["Agent: specify which agent to run"])
    positionalArgs = Script.getPositionalArgs(group=True)
    localCfg = Script.localCfg

    agentName = positionalArgs[0]
    localCfg.setConfigurationForAgent(agentName)
    localCfg.addMandatoryEntry("/DIRAC/Setup")
    localCfg.addDefaultEntry("/DIRAC/Security/UseServerCertificate", "yes")
    localCfg.addDefaultEntry("LogLevel", "INFO")
    localCfg.addDefaultEntry("LogColor", True)
    resultDict = localCfg.loadUserData()
    if not resultDict["OK"]:
        gLogger.error("There were errors when loading configuration",
                      resultDict["Message"])
        sys.exit(1)

    includeExtensionErrors()

    agentReactor = AgentReactor(positionalArgs[0])
    result = agentReactor.loadAgentModules(positionalArgs)
    if result["OK"]:
        agentReactor.go()
        # dirac_agent might interact with ARC library which cannot be closed using a simple sys.exit(0)
        # See https://bugzilla.nordugrid.org/show_bug.cgi?id=4022 for further details
        os._exit(0)
    else:
        gLogger.error("Error while loading agent module", result["Message"])
        sys.exit(2)
Пример #4
0
localCfg = LocalConfiguration()

positionalArgs = localCfg.getPositionalArguments()
if len(positionalArgs) == 0:
    gLogger.initialize("NOT SPECIFIED", "/")
    gLogger.fatal("You must specify which agent to run!")
    sys.exit(1)

agentName = positionalArgs[0]
localCfg.setConfigurationForAgent(agentName)
localCfg.addMandatoryEntry("/DIRAC/Setup")
localCfg.addDefaultEntry("/DIRAC/Security/UseServerCertificate", "yes")
localCfg.addDefaultEntry("LogLevel", "INFO")
resultDict = localCfg.loadUserData()
if not resultDict['OK']:
    gLogger.error("There were errors when loading configuration",
                  resultDict['Message'])
    sys.exit(1)

if len(positionalArgs) == 1:
    mainName = positionalArgs[0]
else:
    mainName = "Framework/MultiAgent"

agentReactor = AgentReactor(mainName)
result = agentReactor.loadAgentModules(positionalArgs)
if result['OK']:
    agentReactor.go()
else:
    gLogger.error("Error while loading agent module", result['Message'])
Пример #5
0
from DIRAC.Core.Utilities.DErrno import includeExtensionErrors

localCfg = LocalConfiguration()

positionalArgs = localCfg.getPositionalArguments()
if len(positionalArgs) == 0:
    gLogger.fatal("You must specify which agent to run!")
    sys.exit(1)

agentName = positionalArgs[0]
localCfg.setConfigurationForAgent(agentName)
localCfg.addMandatoryEntry("/DIRAC/Setup")
localCfg.addDefaultEntry("/DIRAC/Security/UseServerCertificate", "yes")
localCfg.addDefaultEntry("LogLevel", "INFO")
localCfg.addDefaultEntry("LogColor", True)
resultDict = localCfg.loadUserData()
if not resultDict['OK']:
    gLogger.error("There were errors when loading configuration",
                  resultDict['Message'])
    sys.exit(1)

includeExtensionErrors()

agentReactor = AgentReactor(positionalArgs[0])
result = agentReactor.loadAgentModules(positionalArgs)
if result['OK']:
    agentReactor.go()
else:
    gLogger.error("Error while loading agent module", result['Message'])
    sys.exit(2)
Пример #6
0
localCfg = LocalConfiguration()

positionalArgs = localCfg.getPositionalArguments()
if len(positionalArgs) == 0:
    gLogger.initialize("NOT SPECIFIED", "/")
    gLogger.fatal("You must specify which agent to run!")
    sys.exit(1)

if len(positionalArgs) == 1:
    agentName = positionalArgs[0]
    multiAgent = False
else:
    agentName = "Framework/MultiAgent"
    multiAgent = True

localCfg.setConfigurationForAgent(agentName)
localCfg.addMandatoryEntry("/DIRAC/Setup")
localCfg.addDefaultEntry("/DIRAC/Security/UseServerCertificate", "yes")
resultDict = localCfg.loadUserData()
if not resultDict['OK']:
    gLogger.error("There were errors when loading configuration",
                  resultDict['Message'])
    sys.exit(1)

ar = AgentReactor(agentName)
result = ar.loadAgentModules(positionalArgs)
if not result['OK']:
    gLogger.error("Error while loading agent module: %s" % result['Message'])
    sys.exit(1)
ar.go()