Skip to content

Commit eb82201

Browse files
committed
Strip excess slashes when joining path parts in files.sync operation.
We have to manually join the parts because `path.join` depends on the OS of the place pyinfra is executing, not the target host.
1 parent e471865 commit eb82201

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pyinfra/operations/files.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,8 @@ def sync(
484484
# Join remote as unix like
485485
'/'.join(
486486
item for item in
487-
(dest, remote_dirpath, filename)
487+
# Remove any existing / where we're going to join
488+
(dest.rstrip('/'), remote_dirpath.strip('/'), filename.lstrip('/'))
488489
if item
489490
),
490491
))

0 commit comments

Comments
 (0)