Merge pull request #47245 from terminalmage/zeromq-bytes

Ensure we pass hexid as bytes when zmq_filtering enabled
This commit is contained in:
Nicole Thomas 2018-04-23 12:54:57 -04:00 committed by GitHub
commit 42a0e655dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'')