예제 #1
0
 def __getCatalogObject(self):
     try:
         if not self.oCatalog:
             self.oCatalog = CatalogInterface()
         return S_OK()
     except:
         return S_ERROR()
예제 #2
0
    def __getCatalogObject(self):
        """ CatalogInterface instance facade

    :param self: self reference
    """
        try:
            if not self.oCatalog:
                self.oCatalog = CatalogInterface()
            return S_OK()
        except:
            return S_ERROR()
예제 #3
0
from DIRAC import exit as DIRACExit
from DIRAC.Core.Base import Script

Script.setUsageMessage("""
Change status of replica of a given file or a list of files at a given Storage Element 

Usage:
   %s <lfn | fileContainingLfns> <SE> <status>
""" % Script.scriptName)

Script.parseCommandLine()

from DIRAC.DataManagementSystem.Client.ReplicaManager import CatalogInterface

catalog = CatalogInterface()
import sys, os

if not len(sys.argv) == 4:
    Script.showHelp()
    DIRACExit(-1)
else:
    inputFileName = sys.argv[1]
    se = sys.argv[2]
    newStatus = sys.argv[3]

if os.path.exists(inputFileName):
    inputFile = open(inputFileName, 'r')
    string = inputFile.read()
    lfns = string.splitlines()
    inputFile.close()