From 7a5158f3288e57a2f6381c16fdf3aeecc38a317d Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Mon, 12 Aug 2019 11:51:24 +0200 Subject: [PATCH] working on comparing checksums --- compare_checksums.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compare_checksums.py b/compare_checksums.py index 9387fcc..7a7286d 100644 --- a/compare_checksums.py +++ b/compare_checksums.py @@ -25,22 +25,22 @@ def remote_call(arguments): """ cmd = ["ssh", "-i", SSH_KEY_FILE, SSH_REMOTE] cmd.extend(arguments) - result = subprocess.run(" ".join(cmd), as_text=True, check=True, + result = subprocess.run(" ".join(cmd), check=True, stdout=subprocess.PIPE, - universal_newlines=as_text, shell=True) + universal_newlines=True, shell=True) return result.stdout def get_local_backup_members(): tmp_folder = pathlib.Path(TMP_BACKUP_FOLDER) backups = (i for i in tmp_folder.iterdir() if i.suffix==".gz") - return (get_member_name(b.name) for b in backups) + return {get_member_name(b.name) for b in backups} def get_remote_checksums(): result = {} for member in get_local_backup_members(): - remote_path = f"~/{REMOTE_PATH}/{member}/\*" + remote_path = f"{REMOTE_PATH}/{member}/\*" cmd_result = remote_call(["sha256sum", remote_path]) print(cmd_result)