From 8743551143db40ea15bab112922aec9374e799e8 Mon Sep 17 00:00:00 2001 From: vzhestkov Date: Mon, 13 May 2024 14:47:43 +0200 Subject: [PATCH] Get rid of run_func in salt.Minion._target --- salt/minion.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/salt/minion.py b/salt/minion.py index 68733a508c5b..b4ad9d6956d6 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -1857,15 +1857,12 @@ def _target(cls, minion_instance, opts, data, connected, creds_map): uid = salt.utils.user.get_uid(user=opts.get("user", None)) minion_instance.proc_dir = get_proc_dir(opts["cachedir"], uid=uid) - def run_func(minion_instance, opts, data): + with salt.utils.ctx.request_context({"data": data, "opts": opts}): if isinstance(data["fun"], tuple) or isinstance(data["fun"], list): return Minion._thread_multi_return(minion_instance, opts, data) else: return Minion._thread_return(minion_instance, opts, data) - with salt.utils.ctx.request_context({"data": data, "opts": opts}): - run_func(minion_instance, opts, data) - def _execute_job_function( self, function_name, function_args, executors, opts, data ):