From 6e7b25029274f8f0d616539e32bf3f5e5a498bd3 Mon Sep 17 00:00:00 2001 From: Analicia Abernathy Date: Fri, 14 Jun 2024 14:17:00 -0500 Subject: [PATCH] Merge branch 'refactor/backups' of gitlab.com:crafty-controller/crafty-4 into refactor/backups --- app/classes/controllers/management_controller.py | 3 ++- app/classes/shared/server.py | 5 +---- app/migrations/20240308_multi-backup.py | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/classes/controllers/management_controller.py b/app/classes/controllers/management_controller.py index 8a7c020d..a2773560 100644 --- a/app/classes/controllers/management_controller.py +++ b/app/classes/controllers/management_controller.py @@ -208,7 +208,7 @@ class ManagementController: def add_default_backup_config(self, server_id, backup_path): return self.management_helper.add_backup_config( { - "backup_name": "afdgahah", + "backup_name": "Default Backup", "backup_location": Helpers.wtol_path(backup_path), "max_backups": 0, "before": "", @@ -217,6 +217,7 @@ class ManagementController: "shutdown": False, "server_id": server_id, "excluded_dirs": [], + "default": True, } ) diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index 8ebe4450..1301c86e 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -1150,10 +1150,7 @@ class ServerInstance: ) time.sleep(3) conf = HelpersManagement.get_backup_config(backup_id) - conf["backup_location"] = os.path.join( - conf["backup_location"], conf["backup_id"] - ) - backup_location = conf["backup_location"] + backup_location = os.path.join(conf["backup_location"], conf["backup_id"]) if not backup_location: Console.critical("No backup path found. Canceling") return None diff --git a/app/migrations/20240308_multi-backup.py b/app/migrations/20240308_multi-backup.py index 5b139c28..5aea9752 100644 --- a/app/migrations/20240308_multi-backup.py +++ b/app/migrations/20240308_multi-backup.py @@ -8,7 +8,7 @@ import logging from app.classes.models.management import Backups, Schedules from app.classes.shared.helpers import Helpers from app.classes.shared.console import Console -from app.classes.shared.migration import Migrator, MigrateHistory +from app.classes.shared.migration import Migrator from app.classes.shared.file_helpers import FileHelpers logger = logging.getLogger(__name__)