def exec_taskError( cls, jid, cachedJobState, errorMsg, eType ): result = cachedJobState.commitChanges() if not result[ 'OK' ]: cls.log.error( "Cannot write changes to job %s: %s" % ( jid, result[ 'Message' ] ) ) jobState = JobState( jid ) result = jobState.getStatus() if result[ 'OK' ]: if result[ 'Value' ][0].lower() == "failed": return S_OK() else: cls.log.error( "Could not get status of job %s: %s" % ( jid, result[ 'Message ' ] ) ) cls.log.notice( "Job %s: Setting to Failed|%s" % ( jid, errorMsg ) ) return jobState.setStatus( "Failed", errorMsg, source = eType )
def exec_taskError(cls, jid, cachedJobState, errorMsg): result = cachedJobState.commitChanges() if not result["OK"]: cls.log.error("Cannot write changes to job %s: %s" % (jid, result["Message"])) jobState = JobState(jid) result = jobState.getStatus() if result["OK"]: if result["Value"][0].lower() == "failed": return S_OK() else: cls.log.error("Could not get status of job %s: %s" % (jid, result["Message"])) cls.log.notice("Job %s: Setting to Failed|%s" % (jid, errorMsg)) return jobState.setStatus("Failed", errorMsg, source="OptimizationMindHandler")