From 221839e6d669604192df79c2b4ffc2912d941b2e Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 28 Mar 2022 21:01:52 -0400 Subject: [PATCH] only check sha256 when there is something in the remote directory (#172) --- dpdispatcher/ssh_context.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dpdispatcher/ssh_context.py b/dpdispatcher/ssh_context.py index 1f07f231..ff40cdcc 100644 --- a/dpdispatcher/ssh_context.py +++ b/dpdispatcher/ssh_context.py @@ -334,8 +334,9 @@ def upload(self, try: self.ssh_session.sftp.mkdir(os.path.basename(self.remote_root)) except OSError: - # mkdir failed meaning it exists, thus the job is recovered - recover = True + # mkdir failed meaning it exists + if len(self.ssh_session.sftp.listdir(os.path.basename(self.remote_root))): + recover = True self.ssh_session.sftp.chdir(None) cwd = os.getcwd()