Skip to content

Commit 679618c

Browse files
authored
[3001.6] Fix Runners in SSE (#174)
* Runners fix * Rework runner fix * Add changelog for sse fix
1 parent 6a58dfa commit 679618c

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

changelog/165.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix runners that broke when patching for CVE-2021-25281

changelog/166.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix Runners in SSE

salt/client/mixins.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ class AsyncClientMixin(object):
485485
client = None
486486
tag_prefix = None
487487

488-
def _proc_function(self, fun, low, user, tag, jid, daemonize=True):
488+
def _proc_function_remote(self, fun, low, user, tag, jid, daemonize=True):
489489
"""
490490
Run this method in a multiprocess target to execute the function on the
491491
master and fire the return data on the event bus
@@ -509,7 +509,7 @@ def _proc_function(self, fun, low, user, tag, jid, daemonize=True):
509509
except salt.exceptions.EauthAuthenticationError as exc:
510510
log.error(exc)
511511

512-
def _proc_function_local(self, fun, low, user, tag, jid, daemonize=True):
512+
def _proc_function(self, fun, low, user, tag, jid, daemonize=True):
513513
"""
514514
Run this method in a multiprocess target to execute the function
515515
locally and fire the return data on the event bus
@@ -556,15 +556,15 @@ def _gen_async_pub(self, jid=None):
556556
tag = salt.utils.event.tagify(jid, prefix=self.tag_prefix)
557557
return {"tag": tag, "jid": jid}
558558

559-
def asynchronous(self, fun, low, user="UNKNOWN", pub=None, local=False):
559+
def asynchronous(self, fun, low, user="UNKNOWN", pub=None, local=True):
560560
"""
561561
Execute the function in a multiprocess and return the event tag to use
562562
to watch for the return
563563
"""
564564
if local:
565-
proc_func = self._proc_function_local
566-
else:
567565
proc_func = self._proc_function
566+
else:
567+
proc_func = self._proc_function_remote
568568
async_pub = pub if pub is not None else self._gen_async_pub()
569569
proc = salt.utils.process.SignalHandlingProcess(
570570
target=proc_func,

salt/runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def run(self):
287287
outputter = None
288288
display_output(ret, outputter, self.opts)
289289
else:
290-
ret = self._proc_function_local(
290+
ret = self._proc_function(
291291
self.opts["fun"],
292292
low,
293293
user,

salt/wheel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def cmd_async(self, low):
124124
{'jid': '20131219224744416681', 'tag': 'salt/wheel/20131219224744416681'}
125125
"""
126126
fun = low.get("fun")
127-
return self.asynchronous(fun, low)
127+
return self.asynchronous(fun, low, local=False)
128128

129129
def cmd(
130130
self,

0 commit comments

Comments
 (0)