From d46e519137258270bb345ac3932f9e254b032715 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Tue, 23 Jan 2024 14:22:35 -0600 Subject: [PATCH] Fix a few more errors introduced in attempting to resolve issues --- netbox_config_backup/models/backups.py | 2 ++ netbox_config_backup/tasks.py | 1 + 2 files changed, 3 insertions(+) diff --git a/netbox_config_backup/models/backups.py b/netbox_config_backup/models/backups.py index 02cdefb..4f2ee6f 100644 --- a/netbox_config_backup/models/backups.py +++ b/netbox_config_backup/models/backups.py @@ -87,6 +87,8 @@ def get_config(self, index='HEAD'): return {'running': running if running is not None else '', 'startup': startup if startup is not None else ''} def set_config(self, configs, files=('running', 'startup'), pk=None): + from netbox_config_backup.models.repository import (BackupCommit, BackupObject, BackupFile, + BackupCommitTreeChange) from netbox_config_backup.git import repository LOCAL_TIMEZONE = datetime.datetime.now(datetime.timezone.utc).astimezone().tzinfo diff --git a/netbox_config_backup/tasks.py b/netbox_config_backup/tasks.py index bb924e0..b643ac8 100644 --- a/netbox_config_backup/tasks.py +++ b/netbox_config_backup/tasks.py @@ -164,6 +164,7 @@ def backup_job(pk): except Exception as e: logger.error(f'Uncaught Exception on job: {backup}') logger.error(e) + logger.warning(traceback.format_exc()) job_result.set_status(JobResultStatusChoices.STATUS_ERRORED) BackupJob.enqueue_if_needed(backup, delay=delay, job_id=job_result.job_id)