From 01bcf68d13da501eca87326d5804afe29591aaa4 Mon Sep 17 00:00:00 2001 From: Vincent Bidolet Date: Mon, 13 Nov 2023 18:52:02 +0100 Subject: [PATCH] adding *better* filtering --- main.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 2af71d5..b43cfd7 100644 --- a/main.py +++ b/main.py @@ -60,12 +60,11 @@ def read_config_file(filepath: str = "configuration.ini"): arguments.remotehost = parser["restic"]["remotehost"] arguments.repository = parser["restic"]["repository"] arguments.passwordfile = parser["restic"]["passwordfile"] - if "dryrun" in parser["restic"]: - if parser["restic"]["dryrun"].lower() == "true" \ - or (parser["restic"]["dryrun"].isdigit() and parser["restic"]["dryrun"] > 0): - arguments.dryrun = () - else: - arguments.dryrun = False + arguments.dryrun = False + if "dryrun" in parser["restic"] and (parser["restic"]["dryrun"].lower() == "true" \ + or (parser["restic"]["dryrun"].isdigit() and parser["restic"]["dryrun"] > 0)): + arguments.dryrun = True + def restic_backup(dirpath: str, tagslist: list = None):