From 3621672e81e22148815e2b38475c785d8fbd3d88 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 27 Feb 2022 22:03:19 -0500 Subject: [PATCH] appease the linter --- app/classes/shared/server.py | 8 ++++---- app/classes/web/panel_handler.py | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index 06d6b453..4e96cb81 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -569,16 +569,16 @@ class Server: backup_filename = f"{self.settings['backup_path']}/{datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}" logger.info(f"Creating backup of server '{self.settings['server_name']}'" + f" (ID#{self.server_id}, path={self.server_path}) at '{backup_filename}'") - + tempDir = tempfile.mkdtemp() shutil.copytree(self.server_path, tempDir, dirs_exist_ok=True) excluded_dirs = management_helper.get_excluded_backup_dirs(self.server_id) server_dir = helper.get_os_understandable_path(self.settings['path']) - for dir in excluded_dirs: + for my_dir in excluded_dirs: # Take the full path of the excluded dir and replace the server path with the temp path # This is so that we're only deleting excluded dirs from the temp path and not the server path - excluded_dir = helper.get_os_understandable_path(dir).replace(server_dir, helper.get_os_understandable_path(tempDir)) + excluded_dir = helper.get_os_understandable_path(my_dir).replace(server_dir, helper.get_os_understandable_path(tempDir)) # Next, check to see if it is a directory if os.path.isdir(excluded_dir): # If it is a directory, recursively delete the entire directory from the backup @@ -586,7 +586,7 @@ class Server: else: # If not, just remove the file os.remove(excluded_dir) - + shutil.make_archive(helper.get_os_understandable_path(backup_filename), 'zip', tempDir) while len(self.list_backups()) > conf["max_backups"] and conf["max_backups"] > 0: diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index b8a3739b..afccea7a 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -17,7 +17,6 @@ from tornado.ioloop import IOLoop #TZLocal is set as a hidden import on win pipeline from tzlocal import get_localzone from cron_validator import CronValidator -from app.classes.controllers.management_controller import Management_Controller from app.classes.models.server_permissions import Enum_Permissions_Server from app.classes.models.crafty_permissions import Enum_Permissions_Crafty