Skip to content

Commit

Permalink
🐛 [shell.py] Fix ssh.copy() into Windows boxes
Browse files Browse the repository at this point in the history
With consistent=True (default), copying over the same file on a
Windows machine would fail horrendously like:

```OSError('Failed to change the permissions and ownership of the
remote temporary path <FILE_NAME>.<SOME_UUID>.tmp: Failure')```

We couldn't care less about that behavior on those machines, we just
want overwrites to work :)
  • Loading branch information
glima committed Apr 22, 2021
1 parent 398898d commit ea1a4ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lisa/util/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,12 @@ def copy(self, local_path: PurePath, node_path: PurePath) -> None:
assert self._inner_shell
local_path_str = self._purepath_to_str(local_path)
node_path_str = self._purepath_to_str(node_path)
self._inner_shell.put(local_path_str, node_path_str, create_directories=True)
self._inner_shell.put(
local_path_str,
node_path_str,
create_directories=True,
consistent=self.is_posix,
)

def _purepath_to_str(
self, path: Union[Path, PurePath, str]
Expand Down

0 comments on commit ea1a4ae

Please sign in to comment.