Пример #1
0
    def run(self):
        cmds = []
        cmds.extend(self.envSetupCmds)
        cmds.append('cd %s' % self.runPath)
        cmds.append('diffPoolFiles.py -f %s -r %s' %
                    (self.theFile, self.theRefFile))

        # launch the commands
        sc = ShellCommand(cmds, self.logger)
        reply = sc.getRawReply()
        [self.logger.debug(str(l)) for l in reply]

        handle = None
        outFile = '%s__%s.diffPool' % (os.path.basename(
            self.theFile), os.path.basename(self.theRefFile))
        outPath = os.path.join(self.runPath, outFile)

        try:
            handle = open(outPath, 'w')
            handle.writelines(reply)
            handle.close()
            self.logger.debug('Successfully wrote out: %s' % outPath)
            return self.outcome(reply)
        except Exception, e:
            m = 'Unable to output results of diffPoolFiles to file: %s\n' % outPath
            m += str(e)
            self.logger.error(m)
            if handle: handle.close()
            return 1
Пример #2
0
    def run(self):
        cmds = []
        cmds.extend(self.envSetupCmds)
        cmds.append('cd %s;perfmon.py %s %s' %
                    (self.runPath, self.options, self.fileName))

        # launch the commands
        sc = ShellCommand(cmds, self.logger)
        reply = sc.getRawReply()
        [self.logger.debug(str(l)) for l in reply]

        handle = None
        outFile = 'out.perfmon.stdout.txt'
        outPath = os.path.join(self.runPath, outFile)

        try:
            handle = open(outPath, 'w')
            handle.writelines(reply)
            handle.close()
            self.logger.debug('Successfully wrote out: %s' % outPath)
        except Exception, e:
            m = 'Unable to output results of checkFile to file: %s\n' % outPath
            m += str(e)
            self.logger.error(m)
            if handle: handle.close()
            return 1
Пример #3
0
    def run(self):
        poolFiles = [f for f in os.listdir(self.runPath) if f.endswith('.pool.root')]

        statusCode = 0

        for poolFile in poolFiles:
            pathToPoolFile = os.path.join(self.runPath, poolFile)

            cmds = []
            cmds.extend(self.envSetupCmds)
            cmds.append('checkFile.py -f %s' % pathToPoolFile)
            cmds.append('echo "RTT determined that checkFile exit status was: " $?')

            # launch the commands
            sc    = ShellCommand(cmds, self.logger)            
            reply = sc.getRawReply()
            [self.logger.debug(str(l)) for l in reply]

            handle = None
            outFile = poolFile + '.checkFile'
            outPath = os.path.join(self.runPath, outFile)
            
            try:
                handle = open(outPath, 'w')
                handle.writelines(reply)
                handle.close()
                self.logger.debug('Successfully wrote out: %s' % outPath)
                status = self.checkFileStatus(reply)
                if status!=0:
                    self.logger.warning('CheckFile returned error, non-zero status (%d) for %s' % (status, poolFile))
                statusCode += status
            except Exception, e:
                m  = 'Unable to output results of checkFile to file: %s\n' % outPath
                m += str(e)
                self.logger.error(m)
                if handle: handle.close()
                return 1
Пример #4
0
 def run(self):
     self.createRunnerScript()  # dump user runner script into runpath
     sc = ShellCommand(self.cmds, self.logger)
     self.logger.debug(sc.getRawReply())