def _log_package_end_to_db(self): """Record package end to the central apman database log.""" # note we are using self._db_log_record, stored by' _log_package_start_to_db()' try: self._db_log_record.stdout = self._script_thread.out self._db_log_record.stderr = self._script_thread.err self._db_log_record.timed_out = self._script_thread.script_timed_out self._db_log_record.errored = self._script_thread.script_exceptioned PackageLogEntry.finish(self._db_log_record) except: logging.error("Cannot log package end to ApMan DB Log.")
def _log_package_start_to_db(self): """Record package start to the central ApMan database log.""" # store the returned log record so we can use it to update the database in '_log_package_end_to_db()' try: self._db_log_record = PackageLogEntry.start(self.parameters['id'], self.parameters['timeout']) except: logging.error("Cannot log package start to ApMan DB Log.")