def taskCompletedCallBackFunction(self, task):
        databaseFunctions.logTaskCompletedSQL(task)
        try:
            choices = ChoicesDict.fromstring(task.results["stdOut"])
        except Exception:
            LOGGER.exception('Unable to create dic from output %s',
                             task.results['stdOut'])
            choices = ChoicesDict({})
        if self.jobChainLink.passVar is not None:
            if isinstance(self.jobChainLink.passVar, list):
                for index, value in enumerate(self.jobChainLink.passVar):
                    if isinstance(value, ChoicesDict):
                        self.jobChainLink.passVar[index] = choices
                        break
                else:
                    self.jobChainLink.passVar.append(choices)
            else:
                self.jobChainLink.passVar = [
                    choices, self.jobChainLink.passVar
                ]
        else:
            self.jobChainLink.passVar = [choices]

        self.jobChainLink.linkProcessingComplete(task.results["exitCode"],
                                                 self.jobChainLink.passVar)
 def taskCompletedCallBackFunction(self, task):
     #logTaskCompleted()
     self.exitCode += math.fabs(task.results["exitCode"])
     try:
         databaseFunctions.logTaskCompletedSQL(task)
     except MySQLdb.Warning, e:
         print >>sys.stderr, "linkTaskManagerTranscoderCommand.py task %s Suppressing mysqldb.warning: " % (task.UUID), e
    def taskCompletedCallBackFunction(self, task):
        databaseFunctions.logTaskCompletedSQL(task)
        try:
            choices = choicesDic(eval(task.results["stdOut"]))
        except:
            print >> sys.stderr, "Error creating dic from output"
            choices = choicesDic({})
        if self.jobChainLink.passVar != None:
            if isinstance(self.jobChainLink.passVar, list):
                found = False
                for passVarIndex in range(len(self.jobChainLink.passVar)):
                    if isinstance(self.jobChainLink.passVar[passVarIndex],
                                  choicesDic):
                        self.jobChainLink.passVar[passVarIndex] = choices
                if not found:
                    self.jobChainLink.passVar.append(choices)
            else:
                self.jobChainLink.passVar = [
                    choices, self.jobChainLink.passVar
                ]
        else:
            self.jobChainLink.passVar = [choices]

        self.jobChainLink.linkProcessingComplete(task.results["exitCode"],
                                                 self.jobChainLink.passVar)
 def taskCompletedCallBackFunction(self, task):
     #logTaskCompleted()
     self.exitCode += math.fabs(task.results["exitCode"])
     try:
         databaseFunctions.logTaskCompletedSQL(task)
     except MySQLdb.Warning, e:
         print >> sys.stderr, "linkTaskManagerTranscoderCommand.py task %s Suppressing mysqldb.warning: " % (
             task.UUID), e
    def taskCompletedCallBackFunction(self, task):
        self.exitCode = max(self.exitCode, abs(task.results["exitCode"]))
        databaseFunctions.logTaskCompletedSQL(task)

        self.tasksLock.acquire()
        if task.UUID in self.tasks:
            del self.tasks[task.UUID]
        else:
            LOGGER.warning('Task UUID %s not in task list %s', task.UUID,
                           self.tasks)
            exit(1)

        if self.clearToNextLink is True and self.tasks == {}:
            LOGGER.debug('Proceeding to next link %s', self.jobChainLink.UUID)
            self.jobChainLink.linkProcessingComplete(self.exitCode,
                                                     self.jobChainLink.passVar)
        self.tasksLock.release()
예제 #6
0
    def taskCompletedCallBackFunction(self, task):
        #logTaskCompleted()
        self.exitCode += math.fabs(task.results["exitCode"])
        databaseFunctions.logTaskCompletedSQL(task)

        self.tasksLock.acquire()
        if task.UUID in self.tasks:
            del self.tasks[task.UUID]
        else:
            print >>sys.stderr, "Key Value Error:", task.UUID
            print >>sys.stderr, "Key Value Error:", self.tasks
            exit(1)

        
        if self.clearToNextLink == True and self.tasks == {} :
            print "DEBUG proceeding to next link", self.jobChainLink.UUID
            self.jobChainLink.linkProcessingComplete(self.exitCode, self.jobChainLink.passVar)
        self.tasksLock.release()
예제 #7
0
    def taskCompletedCallBackFunction(self, task):
        #logTaskCompleted()
        self.exitCode += math.fabs(task.results["exitCode"])
        databaseFunctions.logTaskCompletedSQL(task)

        self.tasksLock.acquire()
        if task.UUID in self.tasks:
            del self.tasks[task.UUID]
        else:
            print >> sys.stderr, "Key Value Error:", task.UUID
            print >> sys.stderr, "Key Value Error:", self.tasks
            exit(1)

        if self.clearToNextLink == True and self.tasks == {}:
            print "DEBUG proceeding to next link", self.jobChainLink.UUID
            self.jobChainLink.linkProcessingComplete(self.exitCode,
                                                     self.jobChainLink.passVar)
        self.tasksLock.release()
    def taskCompletedCallBackFunction(self, task):
        databaseFunctions.logTaskCompletedSQL(task)
        try:
            choices = choicesDic(eval(task.results["stdOut"]))
        except:
            print >>sys.stderr, "Error creating dic from output"
            choices = choicesDic({})
        if self.jobChainLink.passVar != None:
            if isinstance(self.jobChainLink.passVar, list):
                found = False
                for passVarIndex in range(len(self.jobChainLink.passVar)):
                    if isinstance(self.jobChainLink.passVar[passVarIndex], choicesDic):
                        self.jobChainLink.passVar[passVarIndex] = choices
                if not found:
                   self.jobChainLink.passVar.append(choices)
            else:
                self.jobChainLink.passVar = [choices, self.jobChainLink.passVar] 
        else:
            self.jobChainLink.passVar = [choices]

        self.jobChainLink.linkProcessingComplete(task.results["exitCode"], self.jobChainLink.passVar)
예제 #9
0
 def taskCompletedCallBackFunction(self, task):
     databaseFunctions.logTaskCompletedSQL(task)
     self.jobChainLink.linkProcessingComplete(task.results["exitCode"], self.jobChainLink.passVar)
 def taskCompletedCallBackFunction(self, task):
     databaseFunctions.logTaskCompletedSQL(task)
     self.jobChainLink.linkProcessingComplete(task.results["exitCode"], self.jobChainLink.passVar)