From 85504a91a65c5b48d18bc9220ffb756aad998577 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 31 Jul 2023 14:44:55 -0700 Subject: [PATCH] We only use msgpack > 1.0 now --- salt/transport/tcp.py | 11 ++--------- tests/pytests/unit/test_auth.py | 4 +++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/salt/transport/tcp.py b/salt/transport/tcp.py index d9a7cddfc73..602f9e3b74b 100644 --- a/salt/transport/tcp.py +++ b/salt/transport/tcp.py @@ -25,7 +25,6 @@ import tornado.iostream import tornado.netutil import tornado.tcpclient import tornado.tcpserver -from tornado.locks import Lock import salt.master import salt.payload @@ -808,7 +807,7 @@ class MessageClient: ip_bracket(self.host, strip=True), self.port, ssl_options=self.opts.get("ssl"), - **kwargs + **kwargs, ) except Exception as exc: # pylint: disable=broad-except log.warning( @@ -1497,13 +1496,7 @@ class _TCPPubServerPublisher: self.path = path self._closing = False self.stream = None - # msgpack deprecated `encoding` starting with version 0.5.2 - if salt.utils.msgpack.version >= (0, 5, 2): - # Under Py2 we still want raw to be set to True - msgpack_kwargs = {"raw": False} - else: - msgpack_kwargs = {"encoding": "utf-8"} - self.unpacker = salt.utils.msgpack.Unpacker(**msgpack_kwargs) + self.unpacker = salt.utils.msgpack.Unpacker(raw=False) self._connecting_future = None def connected(self): diff --git a/tests/pytests/unit/test_auth.py b/tests/pytests/unit/test_auth.py index cb0aceef0cd..120d056e87d 100644 --- a/tests/pytests/unit/test_auth.py +++ b/tests/pytests/unit/test_auth.py @@ -159,7 +159,9 @@ def auth_acl_master_opts(master_opts): master_opts["sign_pub_messages"] = False master_opts["con_cache"] = "" master_opts["external_auth"] = {} - master_opts["external_auth"] = {"pam": {"test_user": [{"alpha_minion": ["test.ping"]}]}} + master_opts["external_auth"] = { + "pam": {"test_user": [{"alpha_minion": ["test.ping"]}]} + } yield master_opts