def _getOutputs(): repoLocation = '' clip = _Params() clip.registerSwitches() Script.parseCommandLine( ignoreErrors = False ) repoLocation = clip.repo if not repoLocation: Script.showHelp() dexit(1) from DIRAC import gLogger from DIRAC.Interfaces.API.Dirac import Dirac dirac = Dirac(True, repoLocation) exitCode = 0 res = dirac.monitorRepository(False) if not res['OK']: gLogger.error("Failed because %s" % res['Message']) dexit(1) res = dirac.retrieveRepositorySandboxes() if not res['OK']: gLogger.error("Failed because %s" % res['Message']) dexit(1) if clip.outputdata: res = dirac.retrieveRepositoryData() if not res['OK']: gLogger.error("Failed because %s" % res['Message']) exit(1) dexit(exitCode)
def _getOutputData(): cliParams = _Params() cliParams.registerSwitches() Script.parseCommandLine(ignoreErrors=False) if not cliParams.repo: Script.showHelp() dexit(2) from DIRAC.Interfaces.API.Dirac import Dirac dirac = Dirac(True, cliParams.repo) exitCode = 0 dirac.monitorRepository(False) dirac.retrieveRepositoryData() dexit(exitCode)
def _getOutputData(): cliParams = _Params() cliParams.registerSwitches() Script.parseCommandLine( ignoreErrors = False ) if not cliParams.repo: Script.showHelp() dexit(2) from DIRAC.Interfaces.API.Dirac import Dirac dirac = Dirac(True, cliParams.repo) exitCode = 0 dirac.monitorRepository(False) dirac.retrieveRepositoryData() dexit(exitCode)
def main(): # Registering arguments will automatically add their description to the help menu Script.registerArgument("RepoDir: Location of Job Repository") _, args = Script.parseCommandLine(ignoreErrors=False) repoLocation = args[0] from DIRAC.Interfaces.API.Dirac import Dirac dirac = Dirac(withRepo=True, repoLocation=repoLocation) exitCode = 0 result = dirac.monitorRepository(printOutput=True) if not result["OK"]: print("ERROR: ", result["Message"]) exitCode = 2 DIRAC.exit(exitCode)
def main(): Script.parseCommandLine(ignoreErrors=False) args = Script.getPositionalArgs() if len(args) != 1: Script.showHelp() repoLocation = args[0] from DIRAC.Interfaces.API.Dirac import Dirac dirac = Dirac(withRepo=True, repoLocation=repoLocation) exitCode = 0 result = dirac.monitorRepository(printOutput=True) if not result['OK']: print('ERROR: ', result['Message']) exitCode = 2 DIRAC.exit(exitCode)
""" __RCSID__ = "$Id$" import DIRAC from DIRAC.Core.Base import Script import os, sys Script.setUsageMessage('\n'.join([ __doc__.split('\n')[1], 'Usage:', ' %s [option|cfgfile] ... RepoDir' % Script.scriptName, 'Arguments:', ' RepoDir: Location of Job Repository' ])) Script.parseCommandLine(ignoreErrors=False) args = Script.getPositionalArgs() if len(args) != 1: Script.showHelp() repoLocation = args[0] from DIRAC.Interfaces.API.Dirac import Dirac dirac = Dirac(WithRepo=True, RepoLocation=repoLocation) exitCode = 0 result = dirac.monitorRepository(printOutput=True) if not result['OK']: print 'ERROR: ', result['Message'] exitCode = 2 DIRAC.exit(exitCode)
Monitor the jobs present in the repository """ __RCSID__ = "eab4069 (2011-11-16 10:51:49 +0100) Stephane Poss <*****@*****.**>" import DIRAC from DIRAC.Core.Base import Script import os, sys Script.setUsageMessage( '\n'.join( [ __doc__.split( '\n' )[1], 'Usage:', ' %s [option|cfgfile] ... RepoDir' % Script.scriptName, 'Arguments:', ' RepoDir: Location of Job Repository' ] ) ) Script.parseCommandLine( ignoreErrors = False ) args = Script.getPositionalArgs() if len( args ) != 1: Script.showHelp() repoLocation = args[0] from DIRAC.Interfaces.API.Dirac import Dirac dirac = Dirac( withRepo = True, repoLocation = repoLocation ) exitCode = 0 result = dirac.monitorRepository( printOutput = True ) if not result['OK']: print 'ERROR: ', result['Message'] exitCode = 2 DIRAC.exit( exitCode )
if __name__=="__main__": repoLocation = '' clip = Params() clip.registerSwitches() Script.parseCommandLine( ignoreErrors = False ) repoLocation = clip.repo if not repoLocation: Script.showHelp() dexit(1) from DIRAC import gLogger from DIRAC.Interfaces.API.Dirac import Dirac dirac = Dirac(True, repoLocation) exitCode = 0 res = dirac.monitorRepository(False) if not res['OK']: gLogger.error("Failed because %s" % res['Message']) dexit(1) res = dirac.retrieveRepositorySandboxes() if not res['OK']: gLogger.error("Failed because %s" % res['Message']) dexit(1) if clip.outputdata: res = dirac.retrieveRepositoryData() if not res['OK']: gLogger.error("Failed because %s" % res['Message']) exit(1) dexit(exitCode)