From 3c1b4d4c8b2966bd7b1f767e68430ab4e43dc4cb Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Sat, 28 Jan 2023 19:43:21 +0100 Subject: [PATCH] Minor linter fixes --- npbackup/core/runner.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/npbackup/core/runner.py b/npbackup/core/runner.py index 0d37a38..6773bc6 100644 --- a/npbackup/core/runner.py +++ b/npbackup/core/runner.py @@ -23,7 +23,7 @@ from npbackup.restic_metrics import restic_output_2_metrics, upload_metrics from npbackup.restic_wrapper import ResticRunner from npbackup.core.restic_source_binary import get_restic_internal_binary from npbackup.path_helper import CURRENT_DIR, BASEDIR -from npbackup import __name__ as NAME, __version__ as VERSION +from npbackup import __intname__ as NAME, __version__ as VERSION logger = getLogger(__intname__) @@ -181,7 +181,7 @@ class NPBackupRunner: return wrapper - def create_restic_runner(self): + def create_restic_runner(self) -> None: try: repository = self.config_dict["repo"]["repository"] password = self.config_dict["repo"]["password"] @@ -204,7 +204,9 @@ class NPBackupRunner: logger.info("Using dev binary !") self.restic_runner.binary = binary - def apply_config_to_restic_runner(self): + def apply_config_to_restic_runner(self) -> None: + if not self.restic_runner: + return None try: if self.config_dict["repo"]["upload_speed"]: self.restic_runner.limit_upload = self.config_dict["repo"][ @@ -272,7 +274,9 @@ class NPBackupRunner: logger.error("Cannot initialize additional environment variables") try: - self.minimum_backup_age = int(self.config_dict["repo"]["minimum_backup_age"]) + self.minimum_backup_age = int( + self.config_dict["repo"]["minimum_backup_age"] + ) except (KeyError, ValueError): self.minimum_backup_age = 86400