Ejemplo n.º 1
0
    def removeFile(self, pfnToRemove):
        """
        _removeFile_

        CleanUp pfn provided: specific for Castor-1

        """
        command = "stager_rm -M %s ; nsrm %s" % (pfnToRemove, pfnToRemove)
        execute(command)
Ejemplo n.º 2
0
    def removeFile(self, pfnToRemove):
        """
        _removeFile_

        """
        (_, host, path, _) = self.splitPFN(pfnToRemove)
        command = "xrdfs %s rm %s" % (host, path)
        execute(command)
        return
Ejemplo n.º 3
0
    def removeFile(self, pfnToRemove):
        """
        _removeFile_

        """
        (_, host, path, _) = self.splitPFN(pfnToRemove)
        command = "xrdfs %s rm %s" % (host, path)
        execute(command)
        return
Ejemplo n.º 4
0
    def createDir(self, directory, mode):
        """
        _createDir_

        Creates directory with no permissions

        """
        cmd = "nsmkdir -m %s -p %s" % (mode, directory)
        execute(cmd)

        return
Ejemplo n.º 5
0
    def changeDirMode(self, directory, mode):
        """
        _createDir_

        Sets mode for directory

        """
        cmd = "nschmod %s %s" % (mode, directory)
        execute(cmd)

        return
Ejemplo n.º 6
0
    def setFileClass(self, directory, fileclass):
        """
        _createDir_

        Sets fileclass for specified directory

        """
        cmd = "nschclass %s %s" % (fileclass, directory)
        execute(cmd)

        return
Ejemplo n.º 7
0
    def setFileClass(self, directory, fileclass):
        """
        _setFileClass_

        Sets fileclass for specified directory

        Only used for castor

        """
        cmd = "nschclass %s %s" % (fileclass, directory)
        execute(cmd)
        return
Ejemplo n.º 8
0
    def removeFile(self, pfnToRemove):
        """
        _removeFile_

        """
        if self.isEOS(pfnToRemove):
            command = "xrd eoscms rm %s" % pfnToRemove.replace("root://eoscms//eos/cms/", "/eos/cms/", 1)
        else:
            command = "stager_rm -M \"%s\" ; nsrm \"%s\"" % (pfnToRemove, pfnToRemove)

        execute(command)
        return
Ejemplo n.º 9
0
    def setFileClass(self, directory, fileclass):
        """
        _setFileClass_

        Sets fileclass for specified directory

        Only used for castor

        """
        cmd = "nschclass %s %s" % (fileclass, directory)
        execute(cmd)
        return
Ejemplo n.º 10
0
    def createDir(self, directory):
        """
        _createDir_

        Creates directory with correct permissions

        Only used for castor and local files

        """
        command = "nsmkdir -p \"%s\"" % directory

        execute(command)
        return
Ejemplo n.º 11
0
    def createDir(self, directory):
        """
        _createDir_

        Creates directory with correct permissions

        Only used for castor and local files

        """
        command = "nsmkdir -p \"%s\"" % directory

        execute(command)
        return
Ejemplo n.º 12
0
    def removeFile(self, pfnToRemove):
        """
        _removeFile_

        """
        if self.isEOS(pfnToRemove):

            command = "xrd eoscms rm %s" % pfnToRemove.replace("root://eoscms//eos/cms/", "/eos/cms/", 1)

        else:

            simplePFN = self.parseCastorPath(pfnToRemove)

            command = "stager_rm -a -M %s ; nsrm %s" % (simplePFN, simplePFN)

        execute(command)
        return
Ejemplo n.º 13
0
    def removeFile(self, pfnToRemove):
        """
        _removeFile_

        """
        if self.isEOS(pfnToRemove):

            (_,host,path,_) = self.splitPFN(pfnToRemove)
            command = "xrd %s rm %s" % (host, path)

        else:

            simplePFN = self.parseCastorPath(pfnToRemove)

            command = "stager_rm -a -M %s ; nsrm %s" % (simplePFN, simplePFN)

        execute(command)
        return
Ejemplo n.º 14
0
    def removeFile(self, pfnToRemove):
        """
        _removeFile_

        """
        if self.isEOS(pfnToRemove):

            (_,host,path,_) = self.splitPFN(pfnToRemove)
            command = "xrd %s rm %s" % (host, path)

        else:

            simplePFN = self.parseCastorPath(pfnToRemove)

            command = "stager_rm -a -M %s ; nsrm %s" % (simplePFN, simplePFN)

        execute(command)
        return
Ejemplo n.º 15
0
    def removeFile(self, pfnToRemove):
        """
        _removeFile_

        """
        if self.isEOS(pfnToRemove):

            command = "xrd eoscms rm %s" % pfnToRemove.replace(
                "root://eoscms//eos/cms/", "/eos/cms/", 1)

        else:

            simplePFN = self.parseCastorPath(pfnToRemove)

            command = "stager_rm -a -M %s ; nsrm %s" % (simplePFN, simplePFN)

        execute(command)
        return
Ejemplo n.º 16
0
 def testExecute_executed(self, execute_runCommand):
     execute_runCommand.return_value = None
     self.assertIsNone(execute("test"))
     execute_runCommand.assert_called_with("test")
Ejemplo n.º 17
0
 def testExecute_executed(self, execute_runCommand):
     execute_runCommand.return_value = 0, "test output"
     self.assertIsNone(execute("test"))
     execute_runCommand.assert_called_with("test")