mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Initialize a unique context per wheel/runner execution
This commit is contained in:
parent
117a713502
commit
391e31a525
@ -10,6 +10,7 @@ import weakref
|
||||
import traceback
|
||||
import collections
|
||||
import multiprocessing
|
||||
import tornado.stack_context
|
||||
|
||||
# Import Salt libs
|
||||
import salt.exceptions
|
||||
@ -333,8 +334,10 @@ class SyncClientMixin(object):
|
||||
else:
|
||||
kwargs = low['kwargs']
|
||||
|
||||
data['return'] = self.functions[fun](*args, **kwargs)
|
||||
data['success'] = True
|
||||
# Initialize a context for executing the method.
|
||||
with tornado.stack_context.StackContext(self.functions.context_dict.clone):
|
||||
data['return'] = self.functions[fun](*args, **kwargs)
|
||||
data['success'] = True
|
||||
except (Exception, SystemExit) as ex:
|
||||
if isinstance(ex, salt.exceptions.NotImplemented):
|
||||
data['return'] = str(ex)
|
||||
|
Loading…
Reference in New Issue
Block a user