From 90d594bea7275503a0245c241fe7a4d134ee41d0 Mon Sep 17 00:00:00 2001 From: Nicolas KAROLAK <nicolas@karolak.fr> Date: Tue, 7 May 2019 09:04:44 +0200 Subject: [PATCH] sys.exit -> exit --- tests/test_backup.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_backup.py b/tests/test_backup.py index ca2e4735..8e760b75 100755 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -88,7 +88,7 @@ def test_last_backup_is_recent(server: str) -> bool: "-maxdepth 1", "-xtype l", "-name latest", - "-exec realpath {} +" # must always be last arg + "-exec realpath {} +", # must always be last arg ) cmd = "ssh -o StrictHostKeyChecking=no {} '{}'".format(server, find) status, out = subprocess.getstatusoutput(cmd) @@ -205,17 +205,17 @@ def main(): local_backup_folders = conf.get("LOCAL_BACKUP_FOLDERS") if backup_server: if not test_ssh(backup_server): - sys.exit(1) + exit(1) else: if not test_last_backup_is_recent(backup_server): - sys.exit(1) + exit(1) else: - sys.exit(0) + exit(0) elif local_backup_folders: - sys.exit(not check_local_backups(local_backup_folders)) + exit(not check_local_backups(local_backup_folders)) else: print("No backup_server defined in config, untestable") - sys.exit(2) + exit(2) if __name__ == "__main__": -- GitLab