Merge branch 'refactor/backups' of gitlab.com:crafty-controller/crafty-4 into refactor/backups

This commit is contained in:
Analicia Abernathy 2024-06-14 14:17:00 -05:00
parent ff7a392119
commit 6e7b250292
3 changed files with 4 additions and 6 deletions

View File

@ -208,7 +208,7 @@ class ManagementController:
def add_default_backup_config(self, server_id, backup_path): def add_default_backup_config(self, server_id, backup_path):
return self.management_helper.add_backup_config( return self.management_helper.add_backup_config(
{ {
"backup_name": "afdgahah", "backup_name": "Default Backup",
"backup_location": Helpers.wtol_path(backup_path), "backup_location": Helpers.wtol_path(backup_path),
"max_backups": 0, "max_backups": 0,
"before": "", "before": "",
@ -217,6 +217,7 @@ class ManagementController:
"shutdown": False, "shutdown": False,
"server_id": server_id, "server_id": server_id,
"excluded_dirs": [], "excluded_dirs": [],
"default": True,
} }
) )

View File

@ -1150,10 +1150,7 @@ class ServerInstance:
) )
time.sleep(3) time.sleep(3)
conf = HelpersManagement.get_backup_config(backup_id) conf = HelpersManagement.get_backup_config(backup_id)
conf["backup_location"] = os.path.join( backup_location = os.path.join(conf["backup_location"], conf["backup_id"])
conf["backup_location"], conf["backup_id"]
)
backup_location = conf["backup_location"]
if not backup_location: if not backup_location:
Console.critical("No backup path found. Canceling") Console.critical("No backup path found. Canceling")
return None return None

View File

@ -8,7 +8,7 @@ import logging
from app.classes.models.management import Backups, Schedules from app.classes.models.management import Backups, Schedules
from app.classes.shared.helpers import Helpers from app.classes.shared.helpers import Helpers
from app.classes.shared.console import Console 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 from app.classes.shared.file_helpers import FileHelpers
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)