Esempio n. 1
0
 def cleanup_tempdirs(self, signum=None, frame=None):
     # delete temp files
     util.signal_logger(self.__class__.__name__, signum, frame)
     config = util_mdtf.ConfigManager()
     tmpdirs = util_mdtf.TempDirManager()
     if not config.config.get('keep_temp', False):
         tmpdirs.cleanup()
Esempio n. 2
0
 def runtime_cleanup(self, signum=None, frame=None):
     util.signal_logger(self.__class__.__name__, signum, frame)
     # kill any active subprocesses
     for p in self.pods:
         if p.log_handle is not None:
             p.log_handle.close()
         if p.process is not None:
             p.process.kill()
     exit(1)
Esempio n. 3
0
 def runtime_terminate(self, signum=None, frame=None):
     """Handler called in the event that POD execution was halted abnormally,
     by receiving  ``SIGINT`` or ``SIGTERM``.
     """
     # try to clean up everything
     util.signal_logger(self.__class__.__name__, signum, frame, log=self.case.log)
     for p in self.pods:
         util.signal_logger(self.__class__.__name__, signum, frame, log=p.pod.log)
         p.tear_down()
         p.pod.close_log_file(log=True)
     self.tear_down()
     self.case.close_log_file()
     util.exit_handler(code=1)
 def runtime_terminate(self, signum=None, frame=None):
     # try to clean up everything
     util.signal_logger(self.__class__.__name__,
                        signum,
                        frame,
                        log=self.case.log)
     for p in self.pods:
         util.signal_logger(self.__class__.__name__,
                            signum,
                            frame,
                            log=p.pod.log)
         p.tear_down()
         p.pod.close_log_file(log=True)
     self.tear_down()
     self.case.close_log_file()
     util.exit_handler(code=1)
Esempio n. 5
0
 def subprocess_cleanup(self, signum=None, frame=None):
     util.signal_logger(self.__class__.__name__, signum, frame)
     # kill any active subprocesses
     for pod in self.pods:
         if pod.process_obj is not None:
             pod.process_obj.kill()
Esempio n. 6
0
 def tempdir_cleanup_handler(self, signum=None, frame=None):
     # delete temp files
     util.signal_logger(self.__class__.__name__, signum, frame, log=_log)
     self.cleanup()