Skip to content

Commit

Permalink
mark created symlink as dangling fs obj; postpone dangling fs obj on …
Browse files Browse the repository at this point in the history
…remote cleanup
  • Loading branch information
zhenyu-ms committed Feb 17, 2025
1 parent 9efdba7 commit a123cde
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions testplan/common/remote/remote_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,15 +470,15 @@ def _prepare_workspace(self, exist_on_remote: bool) -> None:
label="imitate local workspace path on remote - ln",
check=False, # just best effort
):
self._dangling_remote_fs_obj = rmt_non_existing
if rmt_non_existing:
self.logger.info(
"%s: on %s, %s and its possible descendants are "
"created to imitate local workspace path",
self,
self.ssh_cfg["host"],
rmt_non_existing,
)
# NOTE: we shall always remove created symlink
self._dangling_remote_fs_obj = rmt_non_existing or self._workspace_paths.local
self.logger.info(
"%s: on %s, %s and its possible descendants are "
"created to imitate local workspace path",
self,
self.ssh_cfg["host"],
self._dangling_remote_fs_obj,
)

def _push_files(self) -> None:
"""Push files and directories to remote host."""
Expand Down Expand Up @@ -660,10 +660,11 @@ def _clean_remote(self) -> None:
)

if self._dangling_remote_fs_obj:
self._execute_cmd_remote(
cmd=rm_cmd(self._dangling_remote_fs_obj),
label=f"Remove imitated workspace outside runpath",
)
# TODO: uncomment later
# self._execute_cmd_remote(
# cmd=rm_cmd(self._dangling_remote_fs_obj),
# label=f"Remove imitated workspace outside runpath",
# )
self._dangling_remote_fs_obj = None

if self.cfg.delete_pushed:
Expand Down

0 comments on commit a123cde

Please sign in to comment.