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()
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)
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)
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()
def tempdir_cleanup_handler(self, signum=None, frame=None): # delete temp files util.signal_logger(self.__class__.__name__, signum, frame, log=_log) self.cleanup()