mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix: Reactor emits critical error
Under normal usage, the reactor will emit this critical error: ``` [CRITICAL] kwargs must be passed inside the low data within the 'kwarg' key. See usage of salt.utils.args.parse_input() and salt.minion.load_args_and_kwargs() elsewhere in the codebase. ``` It seems like only `salt.utils.reactor.Reactor` uses `salt.state.Compiler`. Due to this, it appears safe to customize `Compiler.compile_high_data` for usage only by the reactor. Since reactor arguments are always named, we ensure that each 'chunk' has an `arg` field that is an empty list and a `kwarg` field that contains all the named arguments for use with the given function call. This conforms to the format expected by `salt.client.mixins.SyncClientMixin._low`. Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
This commit is contained in:
parent
33e90be1fe
commit
540977b4b1
1 changed files with 3 additions and 1 deletions
|
@ -577,6 +577,8 @@ class Compiler(object):
|
|||
if '__env__' in body:
|
||||
chunk['__env__'] = body['__env__']
|
||||
chunk['__id__'] = name
|
||||
chunk['arg'] = []
|
||||
chunk['kwarg'] = {}
|
||||
for arg in run:
|
||||
if isinstance(arg, six.string_types):
|
||||
funcs.add(arg)
|
||||
|
@ -589,7 +591,7 @@ class Compiler(object):
|
|||
names.append(_name)
|
||||
continue
|
||||
else:
|
||||
chunk.update(arg)
|
||||
chunk['kwarg'].update(arg)
|
||||
if names:
|
||||
name_order = 1
|
||||
for entry in names:
|
||||
|
|
Loading…
Add table
Reference in a new issue