From 4408cb1fba463aa3fdaba518a74468430dd06895 Mon Sep 17 00:00:00 2001 From: Hugh Secker-Walker Date: Sat, 28 Jan 2023 11:04:46 -0500 Subject: [PATCH] fix(rsync-backup): Provide default port 22 for rsync usage in backup.py (#2226) Co-authored-by: Hugh Secker-Walker --- management/backup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/management/backup.py b/management/backup.py index 3c4c38d7..99c3d60e 100755 --- a/management/backup.py +++ b/management/backup.py @@ -221,7 +221,9 @@ def get_duplicity_additional_args(env): port = urlsplit(config["target"]).port except ValueError: port = 22 - + if port is None: + port = 22 + return [ f"--ssh-options= -i /root/.ssh/id_rsa_miab -p {port}", f"--rsync-options= -e \"/usr/bin/ssh -oStrictHostKeyChecking=no -oBatchMode=yes -p {port} -i /root/.ssh/id_rsa_miab\"", @@ -424,6 +426,8 @@ def list_target_files(config): port = target.port except ValueError: port = 22 + if port is None: + port = 22 target_path = target.path if not target_path.endswith('/'):