mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #38925 from terminalmage/issue38540
Fix two wheel issues in netapi
This commit is contained in:
commit
b27733cc33
2 changed files with 14 additions and 5 deletions
|
@ -1805,9 +1805,9 @@ class ClearFuncs(object):
|
|||
'user': token['name']}
|
||||
try:
|
||||
self.event.fire_event(data, tagify([jid, 'new'], 'wheel'))
|
||||
ret = self.wheel_.call_func(fun, **clear_load)
|
||||
data['return'] = ret
|
||||
data['success'] = True
|
||||
ret = self.wheel_.call_func(fun, full_return=True, **clear_load)
|
||||
data['return'] = ret['return']
|
||||
data['success'] = ret['success']
|
||||
self.event.fire_event(data, tagify([jid, 'ret'], 'wheel'))
|
||||
return {'tag': tag,
|
||||
'data': data}
|
||||
|
|
|
@ -668,8 +668,17 @@ class SignalHandlingMultiprocessingProcess(MultiprocessingProcess):
|
|||
def default_signals(*signals):
|
||||
old_signals = {}
|
||||
for signum in signals:
|
||||
old_signals[signum] = signal.getsignal(signum)
|
||||
signal.signal(signum, signal.SIG_DFL)
|
||||
try:
|
||||
signal.signal(signum, signal.SIG_DFL)
|
||||
old_signals[signum] = signal.getsignal(signum)
|
||||
except ValueError as exc:
|
||||
# This happens when a netapi module attempts to run a function
|
||||
# using wheel_async, because the process trying to register signals
|
||||
# will not be the main PID.
|
||||
log.trace(
|
||||
'Failed to register signal for signum %d: %s',
|
||||
signum, exc
|
||||
)
|
||||
|
||||
# Do whatever is needed with the reset signals
|
||||
yield
|
||||
|
|
Loading…
Add table
Reference in a new issue