From a951a885769c2a2b8ea582ff4b98ad25627cb2e7 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 25 Jul 2023 12:55:03 -0700 Subject: [PATCH] Bump msgpack minimum version --- requirements/base.txt | 2 +- salt/transport/tcp.py | 8 +------- salt/utils/msgpack.py | 4 ---- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 9225efd2707..3f0f44e5b29 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,6 +1,6 @@ Jinja2 jmespath -msgpack>=0.5,!=0.5.5 +msgpack>=0.5.2,!=0.5.5 PyYAML MarkupSafe requests>=1.0.0 diff --git a/salt/transport/tcp.py b/salt/transport/tcp.py index 32284e316a4..c650ac90d46 100644 --- a/salt/transport/tcp.py +++ b/salt/transport/tcp.py @@ -1262,13 +1262,7 @@ class TCPPuller: else: return _null - # 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"} - unpacker = salt.utils.msgpack.Unpacker(**msgpack_kwargs) + unpacker = salt.utils.msgpack.Unpacker(raw=False) while not stream.closed(): try: wire_bytes = await stream.read_bytes(4096, partial=True) diff --git a/salt/utils/msgpack.py b/salt/utils/msgpack.py index df4ac6cb9c6..9c1baedbf12 100644 --- a/salt/utils/msgpack.py +++ b/salt/utils/msgpack.py @@ -61,10 +61,6 @@ def _sanitize_msgpack_kwargs(kwargs): assert isinstance(kwargs, dict) if version < (0, 6, 0) and kwargs.pop("strict_map_key", None) is not None: log.info("removing unsupported `strict_map_key` argument from msgpack call") - if version < (0, 5, 2) and kwargs.pop("raw", None) is not None: - log.info("removing unsupported `raw` argument from msgpack call") - if version < (0, 4, 0) and kwargs.pop("use_bin_type", None) is not None: - log.info("removing unsupported `use_bin_type` argument from msgpack call") if version >= (1, 0, 0) and kwargs.pop("encoding", None) is not None: log.debug("removing unsupported `encoding` argument from msgpack call")