Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back-port #34256 to 2016.3 #34343

Merged
merged 2 commits into from
Jun 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions salt/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -1932,7 +1932,13 @@ def event(self, chunk_ret, length, fire_event=False):
chunk is evaluated an event will be set up to the master with the
results.
'''
if not self.opts.get('local') and (self.opts.get('state_events', True) or fire_event) and self.opts.get('master_uri'):
if not self.opts.get('local') and (self.opts.get('state_events', True) or fire_event):
if not self.opts.get('master_uri'):
ev_func = lambda ret, tag, preload=None: salt.utils.event.get_master_event(
self.opts, self.opts['sock_dir'], listen=False).fire_event(ret, tag)
else:
ev_func = self.functions['event.fire_master']

ret = {'ret': chunk_ret}
if fire_event is True:
tag = salt.utils.event.tagify(
Expand All @@ -1948,7 +1954,7 @@ def event(self, chunk_ret, length, fire_event=False):
)
ret['len'] = length
preload = {'jid': self.jid}
self.functions['event.fire_master'](ret, tag, preload=preload)
ev_func(ret, tag, preload=preload)

def call_chunk(self, low, running, chunks):
'''
Expand Down