Skip to content

Commit 027db66

Browse files
committed
Add minion_legacy_req_warnings option to avoid noisy warnings
1 parent aa40615 commit 027db66

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
From d0ab0bfd0846e38df6c791222a364e82b52a34d9 Mon Sep 17 00:00:00 2001
2+
From: Victor Zhestkov <[email protected]>
3+
Date: Thu, 3 Jul 2025 17:49:35 +0200
4+
Subject: [PATCH] Add `minion_legacy_req_warnings` option to avoid
5+
noisy warnings
6+
7+
---
8+
salt/channel/server.py | 2 +-
9+
tests/pytests/unit/transport/test_zeromq.py | 22 ++++++++++++++++++---
10+
2 files changed, 20 insertions(+), 4 deletions(-)
11+
12+
diff --git a/salt/channel/server.py b/salt/channel/server.py
13+
index abef8aa2f0..1d7cc9c577 100644
14+
--- a/salt/channel/server.py
15+
+++ b/salt/channel/server.py
16+
@@ -819,7 +819,7 @@ class ReqServerChannel:
17+
ret["aes"] = cipher.encrypt(aes)
18+
ret["session"] = cipher.encrypt(salt.utils.stringutils.to_bytes(self.session_key(load["id"])))
19+
20+
- if version < 3:
21+
+ if version < 3 and self.opts.get("minion_legacy_req_warnings", True):
22+
log.warning(
23+
"Minion using legacy request server protocol, please upgrade %s",
24+
load["id"],
25+
diff --git a/tests/pytests/unit/transport/test_zeromq.py b/tests/pytests/unit/transport/test_zeromq.py
26+
index 558f753778..fd0e4b1977 100644
27+
--- a/tests/pytests/unit/transport/test_zeromq.py
28+
+++ b/tests/pytests/unit/transport/test_zeromq.py
29+
@@ -1034,7 +1034,7 @@ async def test_req_chan_decode_data_dict_entry_v2_bad_key(pki_dir, master_opts,
30+
assert "Key verification failed." == excinfo.value.message
31+
32+
33+
-async def test_req_serv_auth_v1(pki_dir, master_opts, minion_opts):
34+
+async def test_req_serv_auth_v1(pki_dir, master_opts, minion_opts, caplog):
35+
minion_opts.update(
36+
{
37+
"master_uri": "tcp://127.0.0.1:4506",
38+
@@ -1088,8 +1088,24 @@ async def test_req_serv_auth_v1(pki_dir, master_opts, minion_opts):
39+
"token": token,
40+
"pub": pub_key,
41+
}
42+
- ret = server._auth(load, sign_messages=False)
43+
- assert "load" not in ret
44+
+ with caplog.at_level(logging.WARNING):
45+
+ ret = server._auth(load, sign_messages=False)
46+
+ assert "Minion using legacy request server protocol, please upgrade minion" in caplog.text
47+
+ assert "load" not in ret
48+
+
49+
+ caplog.clear()
50+
+
51+
+ with caplog.at_level(logging.WARNING), patch.dict(server.opts, {"minion_legacy_req_warnings": False}):
52+
+ ret = server._auth(load, sign_messages=False)
53+
+ assert "Minion using legacy request server protocol, please upgrade minion" not in caplog.text
54+
+ assert "load" not in ret
55+
+
56+
+ caplog.clear()
57+
+
58+
+ with caplog.at_level(logging.WARNING), patch.dict(server.opts, {"minion_legacy_req_warnings": True}):
59+
+ ret = server._auth(load, sign_messages=False)
60+
+ assert "Minion using legacy request server protocol, please upgrade minion" in caplog.text
61+
+ assert "load" not in ret
62+
63+
64+
async def test_req_serv_auth_v2(pki_dir, master_opts, minion_opts):
65+
--
66+
2.50.0
67+

salt/salt.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,8 @@ Patch174: several-fixes-for-security-issues.patch
566566
# PATCH-FIX_UPSTREAM: https://github.com/saltstack/salt/pull/68125
567567
# PATCH-FIX_OPENSUSE: https://github.com/openSUSE/salt/pull/721
568568
Patch175: fix-tests-issues-in-salt-shaker-environments-721.patch
569+
# PATCH-FIX_OPENSUSE: https://github.com/openSUSE/salt/pull/722
570+
Patch176: add-minion_legacy_req_warnings-option-to-avoid-noisy.patch
569571

570572
### IMPORTANT: The line below is used as a snippet marker. Do not touch it.
571573
### SALT PATCHES LIST END

0 commit comments

Comments
 (0)