fire_args: fix UnboundLocalError: local variable 'tag'

Fix this exception which occurs in the exception handler
inside fire_args:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/salt/minion.py", line 1493, in _thread_return
    return_data = executor.execute()
  File "/usr/lib64/python2.7/site-packages/salt/executors/direct_call.py", line 28, in execute
    return self.func(*self.args, **self.kwargs)
  File "/usr/lib64/python2.7/site-packages/salt/modules/saltutil.py", line 1437, in runner
    prefix='run'
  File "/usr/lib64/python2.7/site-packages/salt/utils/event.py", line 181, in fire_args
    tag, tag_data, exc
UnboundLocalError: local variable 'tag' referenced before assignment

Fixes: https://github.com/saltstack/salt/issues/46120
This commit is contained in:
Zac Medico 2018-02-13 18:51:26 -08:00 committed by rallytime
parent 4ce2c21824
commit ee4ee5b619
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19

View file

@ -172,9 +172,9 @@ def fire_args(opts, jid, tag_data, prefix=''):
except NameError:
pass
else:
tag = tagify(tag_suffix, prefix)
try:
_event = get_master_event(opts, opts['sock_dir'], listen=False)
tag = tagify(tag_suffix, prefix)
_event.fire_event(tag_data, tag=tag)
except Exception as exc:
# Don't let a problem here hold up the rest of the orchestration