mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Ensure we pass hexid as bytes when zmq_filtering enabled
When using hashlib and running `.hexdigest()`, a `str` type is returned. It needs to be converted to a bytes type for the setsockopt a few lines below, if zmq_filtering is enabled and the master is running Python 3.
This commit is contained in:
parent
bf3a67d11b
commit
a7accc0548
1 changed files with 4 additions and 1 deletions
|
@ -351,7 +351,10 @@ class AsyncZeroMQPubChannel(salt.transport.mixins.auth.AESPubClientMixin, salt.t
|
|||
if self.opts['zmq_filtering']:
|
||||
# TODO: constants file for "broadcast"
|
||||
self._socket.setsockopt(zmq.SUBSCRIBE, b'broadcast')
|
||||
self._socket.setsockopt(zmq.SUBSCRIBE, self.hexid)
|
||||
self._socket.setsockopt(
|
||||
zmq.SUBSCRIBE,
|
||||
salt.utils.stringutils.to_bytes(self.hexid)
|
||||
)
|
||||
else:
|
||||
self._socket.setsockopt(zmq.SUBSCRIBE, b'')
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue