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)
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)