Beispiel #1
0
    def run(self):
        fValidation = True
        tb = None
        sConsole = None
        oOut = None
        try:
            sConsole, oOut = _capture_stdout(self.task)
            fValidation = self.validate(oOut)
        except:
            import traceback

            fValidation = False
            tb = traceback.format_exc()
        if fValidation is not False:
            eventlog.task_success(self.get_name(), 0)
        else:
            eventlog.task_failure(self.get_name(), 0, tb)
        return {"console": sConsole, "result": oOut, "valid": fValidation, "tb": tb}
Beispiel #2
0
 def run(self):
     fValidation = True
     tb = None
     sConsole = None
     oOut = None
     try:
         sConsole,oOut = _capture_stdout(self.task)
         fValidation = self.validate(oOut)
     except KeyboardInterrupt:
         raise
     except:
         import traceback
         fValidation = False
         tb = traceback.format_exc()
     if fValidation is not False:
         eventlog.task_success(self.get_name(), 0)
     else:
         eventlog.task_failure(self.get_name(), 0, tb)
     return {"console": sConsole, "result": oOut, "valid": fValidation,
             "tb": tb}