From 3b27d578f4cc81774a76eb8db7124022a838e64e Mon Sep 17 00:00:00 2001 From: nicholasyang Date: Mon, 26 Aug 2024 15:22:08 +0800 Subject: [PATCH] fixup! Fix: prun: allow pcopy_to_remote to use intercept (bsc#1228271) --- crmsh/prun/prun.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crmsh/prun/prun.py b/crmsh/prun/prun.py index cc153a123..23c6b9106 100644 --- a/crmsh/prun/prun.py +++ b/crmsh/prun/prun.py @@ -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. @@ -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: @@ -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) }