Merge pull request #28263 from cachedout/issue_26411-1

New channel for event.send
This commit is contained in:
Pedro Algarvio 2015-10-26 14:07:06 +00:00
commit a6cc84c407

View File

@ -51,16 +51,23 @@ def fire_master(data, tag, preload=None):
pass
return True
if preload:
if preload or __opts__.get('__cli') == 'salt-call':
# If preload is specified, we must send a raw event (this is
# slower because it has to independently authenticate)
load = preload
if 'master_uri' not in __opts__:
__opts__['master_uri'] = 'tcp://{ip}:{port}'.format(
ip=salt.utils.ip_bracket(__opts__['interface']),
port=__opts__.get('ret_port', '4506') # TODO, no fallback
)
auth = salt.crypt.SAuth(__opts__)
load.update({'id': __opts__['id'],
load = {'id': __opts__['id'],
'tag': tag,
'data': data,
'tok': auth.gen_token('salt'),
'cmd': '_minion_event'})
'cmd': '_minion_event'}
if isinstance(preload, dict):
load.update(preload)
channel = salt.transport.Channel.factory(__opts__)
try: