diff --git a/asci_to_vault.py b/asci_to_vault.py index ca326091b7815e26d796af103292b4b9771a4f40..f01c653302a76ad919833ffd5a0d0f2ed38a38e8 100644 --- a/asci_to_vault.py +++ b/asci_to_vault.py @@ -112,10 +112,6 @@ def tar_and_send_directory(node): echo=True ) files = files.stdout.strip() - # if not c.is_connected(): - # print(f'Connection failed on {node.src}') - # node.error = "Connection failure on initial file find" - # return node.count = len(files.splitlines()) print(f'Node:{node.src}, file count:{node.count}') @@ -146,9 +142,6 @@ def tar_and_send_directory(node): f"ssh {REMOTE_LOGIN} 'cd {node.src};" f"find -maxdepth 1 -type f -print0 |" f"cpio -o -H ustar -0' | cat > {node.dest}/{filename}.tar", - # f"ssh {REMOTE_LOGIN} 'cd {node.src};" - # rf"find -maxdepth 1 -type f -printf '%f\n' -print0 | tee >(md5sum >)" - # f"cpio -o -H ustar -0' | cat > {node.dest}/{filename}.tar", shell=True, check=True ) @@ -185,7 +178,7 @@ if __name__ == "__main__": # Get the directory tree from remote server as a list with Connection(REMOTE_LOGIN) as c: result = c.run(f'find {SRC_PATH} -type d') - remote_dirs = result.stdout.strip().split('\n') + remote_dirs = result.stdout.strip().splitlines() # Create a tree data structure that represents both source and # destination tree paths. diff --git a/md5_to_vault.py b/md5_to_vault.py index db9885c2a2852eedfafbdaea624377ef4067c768..119cf2abe9e4fd182c6215b88347c78a0c102026 100644 --- a/md5_to_vault.py +++ b/md5_to_vault.py @@ -148,7 +148,7 @@ if __name__ == "__main__": # Get the directory tree from remote server as a list with Connection(REMOTE_LOGIN) as c: result = c.run(f'find {SRC_PATH} -type d') - remote_dirs = result.stdout.strip().split('\n') + remote_dirs = result.stdout.strip().splitlines() # Create a tree data structure that represents both source and # destination tree paths.