Skip to content

Commit

Permalink
fixup! Fix: prun: allow pcopy_to_remote to use intercept (bsc#1228271)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasyang2022 committed Aug 26, 2024
1 parent 131aa8b commit 3b27d57
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crmsh/prun/prun.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def pfetch_from_remote(
recursive=False,
*,
concurrency: int = _DEFAULT_CONCURRENCY,
interceptor: PRunInterceptor = PRunInterceptor(),
) -> typing.Dict[str, typing.Union[str, PRunError]]:
"""Copy files from remote hosts to local concurrently.
Expand All @@ -238,7 +239,7 @@ def pfetch_from_remote(
tasks = [_build_fetch_task("-S '{}'".format(ssh.name), host, src, dst, flags) for host in hosts]
runner = Runner(concurrency)
for task in tasks:
runner.add_task(task)
runner.add_task(interceptor.task(task))
runner.run()
finally:
if ssh is not None:
Expand All @@ -247,7 +248,7 @@ def pfetch_from_remote(
basename = os.path.basename(src)
return {
host: v if v is not None else f"{dst}/{host}/{basename}"
for host, v in ((task.context['host'], _parse_copy_result(task)) for task in tasks)
for host, v in ((task.context['host'], _parse_copy_result(task, interceptor)) for task in tasks)
}


Expand Down

0 comments on commit 3b27d57

Please sign in to comment.