Skip to content

Commit

Permalink
fix: fix the remote path in SSH when local is Windows (#472)
Browse files Browse the repository at this point in the history
Fix #471.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit



- **Improvements**
- Enhanced file path handling for better cross-platform compatibility in
the upload process.
- Improved robustness of temporary file path generation for SHA256
checks and file listings.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
njzjz and pre-commit-ci[bot] authored Jul 25, 2024
1 parent 1e9eb06 commit 723f0b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dpdispatcher/contexts/ssh_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,9 @@ def upload(
).as_posix()
sha256_list.append(f"{sha256} {jj_rel}")
# write to remote
sha256_file = os.path.join(
self.remote_root, ".tmp.sha256." + str(uuid.uuid4())
)
sha256_file = pathlib.PurePath(
os.path.join(self.remote_root, ".tmp.sha256." + str(uuid.uuid4()))
).as_posix()
self.write_file(sha256_file, "\n".join(sha256_list))
# check sha256
# `:` means pass: https://stackoverflow.com/a/2421592/9567349
Expand Down

0 comments on commit 723f0b9

Please sign in to comment.