Exemplo n.º 1
0
    def __init__(self, *args, **kwargs):
        """ c'tor
    """
        DIRACValidateOutputDataAgent.__init__(self, *args, **kwargs)

        self.integrityClient = None
        self.fileCatalog = None
        self.transClient = None
        self.storageUsageClient = None
Exemplo n.º 2
0
    def getTransformationDirectories(self, transID):
        """ get the directories for the supplied transformation from the transformation system

    :param self: self reference
    :param int transID: transformation ID
    """

        res = DIRACValidateOutputDataAgent.getTransformationDirectories(
            self, transID)

        if res['OK']:
            directories = res['Value']
        else:
            return res

        if 'StorageUsage' in self.directoryLocations:
            res = self.storageUsageClient.getStorageDirectories(
                '', '', transID, [])
            if not res['OK']:
                self.log.error("Failed to obtain storage usage directories",
                               res['Message'])
                return res
            transDirectories = res['Value']
            directories = self._addDirs(transID, transDirectories, directories)

        if not directories:
            self.log.info("No output directories found")
        directories = sorted(directories)
        return S_OK(directories)
Exemplo n.º 3
0
    def initialize(self):
        """ standard initialize method for DIRAC agents
    """
        res = DIRACValidateOutputDataAgent.initialize(self)
        if not res['OK']:
            return res

        self.integrityClient = DataIntegrityClient()
        self.fileCatalog = FileCatalog()
        self.transClient = TransformationClient()
        self.storageUsageClient = StorageUsageClient()

        return S_OK()
def main():
    # Registering arguments will automatically add their description to the help menu
    Script.registerArgument(["transID: transformation ID"])
    _, args = Script.parseCommandLine()

    transIDs = [int(arg) for arg in args]

    from DIRAC.TransformationSystem.Agent.ValidateOutputDataAgent import ValidateOutputDataAgent

    agent = ValidateOutputDataAgent(
        "Transformation/ValidateOutputDataAgent",
        "Transformation/ValidateOutputDataAgent",
        "dirac-transformation-verify-outputdata",
    )
    agent.initialize()

    for transID in transIDs:
        agent.checkTransformationIntegrity(transID)
def main():
  Script.parseCommandLine()

  args = Script.getPositionalArgs()
  if not args:
    Script.showHelp()

  transIDs = [int(arg) for arg in args]

  from DIRAC.TransformationSystem.Agent.ValidateOutputDataAgent import ValidateOutputDataAgent
  from DIRAC.TransformationSystem.Client.TransformationClient import TransformationClient

  agent = ValidateOutputDataAgent('Transformation/ValidateOutputDataAgent',
                                  'Transformation/ValidateOutputDataAgent',
                                  'dirac-transformation-verify-outputdata')
  agent.initialize()

  client = TransformationClient()
  for transID in transIDs:
    agent.checkTransformationIntegrity(transID)
parseCommandLine()

import sys
if len( sys.argv ) < 2:
  print 'Usage: dirac-transformation-verify-outputdata transID [transID] [transID]'
  sys.exit()
else:
  transIDs = [int( arg ) for arg in sys.argv[1:]]

from DIRAC.TransformationSystem.Agent.ValidateOutputDataAgent       import ValidateOutputDataAgent
from DIRAC.TransformationSystem.Client.TransformationClient         import TransformationClient
from DIRAC import gLogger
import DIRAC

agent = ValidateOutputDataAgent( 'Transformation/ValidateOutputDataAgent',
                                 'Transformation/ValidateOutputDataAgent',
                                 'dirac-transformation-verify-outputdata' )
agent.initialize()

client = TransformationClient()
for transID in transIDs:
  res = client.getTransformationParameters( transID, ['Status'] )
  if not res['OK']:
    gLogger.error( "Failed to determine transformation status" )
    gLogger.error( res['Message'] )
    continue
  status = res['Value']
  if not status in ['ValidatingOutput', 'WaitingIntegrity', 'Active', 'Completed']:
    gLogger.error( "The transformation is in %s status and can not be validated" % status )
    continue
  agent.checkTransformationIntegrity( transID )
#!/usr/bin/env python
from DIRAC.Core.Base.Script import parseCommandLine

parseCommandLine()

import sys
if len(sys.argv) < 2:
    print 'Usage: dirac-transformation-verify-outputdata transID [transID] [transID]'
    sys.exit()
else:
    transIDs = [int(arg) for arg in sys.argv[1:]]

from DIRAC.TransformationSystem.Agent.ValidateOutputDataAgent import ValidateOutputDataAgent
from DIRAC.TransformationSystem.Client.TransformationClient import TransformationClient
from DIRAC import gLogger
import DIRAC

agent = ValidateOutputDataAgent('Transformation/ValidateOutputDataAgent',
                                'Transformation/ValidateOutputDataAgent',
                                'dirac-transformation-verify-outputdata')
agent.initialize()

client = TransformationClient()
for transID in transIDs:
    agent.checkTransformationIntegrity(transID)