mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Fix event unpack
This commit is contained in:
parent
19cd97ed3b
commit
58ad558346
@ -127,4 +127,7 @@ class Engine(SignalHandlingMultiprocessingProcess):
|
||||
try:
|
||||
self.engine[self.fun](**kwargs)
|
||||
except Exception as exc:
|
||||
log.critical('Engine {0} could not be started! Error: {1}'.format(self.engine, exc))
|
||||
log.critical(
|
||||
'Engine \'%s\' could not be started!',
|
||||
self.fun.split('.')[0], exc_info=True
|
||||
)
|
||||
|
@ -91,8 +91,8 @@ SUB_EVENT = set([
|
||||
'state.sls',
|
||||
])
|
||||
|
||||
TAGEND = '\n\n' # long tag delimiter
|
||||
TAGPARTER = '/' # name spaced tag delimiter
|
||||
TAGEND = str('\n\n') # long tag delimiter
|
||||
TAGPARTER = str('/') # name spaced tag delimiter
|
||||
SALT = 'salt' # base prefix for all salt/ events
|
||||
# dict map of namespaced base tag prefixes for salt events
|
||||
TAGS = {
|
||||
@ -725,15 +725,12 @@ class SaltEvent(object):
|
||||
is_msgpacked=True,
|
||||
use_bin_type=six.PY3
|
||||
)
|
||||
log.debug('Sending event: tag = {0}; data = {1}'.format(tag, data))
|
||||
if six.PY2:
|
||||
event = '{0}{1}{2}'.format(tag, tagend, serialized_data)
|
||||
else:
|
||||
event = b''.join([
|
||||
salt.utils.to_bytes(tag),
|
||||
salt.utils.to_bytes(tagend),
|
||||
serialized_data])
|
||||
msg = salt.utils.to_bytes(event, 'utf-8')
|
||||
log.debug('Sending event: tag = %s; data = %s', tag, data)
|
||||
event = b''.join([
|
||||
salt.utils.stringutils.to_bytes(tag),
|
||||
salt.utils.stringutils.to_bytes(tagend),
|
||||
serialized_data])
|
||||
msg = salt.utils.stringutils.to_bytes(event, 'utf-8')
|
||||
if self._run_io_loop_sync:
|
||||
with salt.utils.async.current_ioloop(self.io_loop):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user