Skip to content
Snippets Groups Projects
Verified Commit 90d594be authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

sys.exit -> exit

parent 9db010ee
No related branches found
No related tags found
No related merge requests found
...@@ -88,7 +88,7 @@ def test_last_backup_is_recent(server: str) -> bool: ...@@ -88,7 +88,7 @@ def test_last_backup_is_recent(server: str) -> bool:
"-maxdepth 1", "-maxdepth 1",
"-xtype l", "-xtype l",
"-name latest", "-name latest",
"-exec realpath {} +" # must always be last arg "-exec realpath {} +", # must always be last arg
) )
cmd = "ssh -o StrictHostKeyChecking=no {} '{}'".format(server, find) cmd = "ssh -o StrictHostKeyChecking=no {} '{}'".format(server, find)
status, out = subprocess.getstatusoutput(cmd) status, out = subprocess.getstatusoutput(cmd)
...@@ -205,17 +205,17 @@ def main(): ...@@ -205,17 +205,17 @@ def main():
local_backup_folders = conf.get("LOCAL_BACKUP_FOLDERS") local_backup_folders = conf.get("LOCAL_BACKUP_FOLDERS")
if backup_server: if backup_server:
if not test_ssh(backup_server): if not test_ssh(backup_server):
sys.exit(1) exit(1)
else: else:
if not test_last_backup_is_recent(backup_server): if not test_last_backup_is_recent(backup_server):
sys.exit(1) exit(1)
else: else:
sys.exit(0) exit(0)
elif local_backup_folders: elif local_backup_folders:
sys.exit(not check_local_backups(local_backup_folders)) exit(not check_local_backups(local_backup_folders))
else: else:
print("No backup_server defined in config, untestable") print("No backup_server defined in config, untestable")
sys.exit(2) exit(2)
if __name__ == "__main__": if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment