From 7413cdfcc0037e75a91445e6dcc6e8dc693c4bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Thu, 1 Feb 2024 10:58:38 +0100 Subject: [PATCH 01/96] Update backport action Backport action was moved from https://github.com/sqren/backport-github-action to https://github.com/sorenlouv/backport-github-action --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index b70b84df5b3..0f61ba09040 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -33,7 +33,7 @@ jobs: ) steps: - name: Backport Action - uses: sqren/backport-github-action@v8.9.7 + uses: sorenlouv/backport-github-action@v8.9.7 with: github_token: ${{ secrets.GITHUB_TOKEN }} auto_backport_label_prefix: "backport:" From e4a62fe2d5572571b1ef8307e23045b4c053ac30 Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Tue, 30 Jan 2024 13:24:03 -0700 Subject: [PATCH 02/96] Find libcrypto.dylib in macos Find libcrypto in non-relenv installations where Salt is installed using pip. For example: `pip install -e .` --- salt/utils/rsax931.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/salt/utils/rsax931.py b/salt/utils/rsax931.py index fb8a1cbbd74..b167e9f211e 100644 --- a/salt/utils/rsax931.py +++ b/salt/utils/rsax931.py @@ -33,8 +33,13 @@ def _find_libcrypto(): elif salt.utils.platform.is_darwin(): # will look for several different location on the system, - # Search in the following order. salts pkg, homebrew, macports, finnally - # system. + # Search in the following order: + # - salt's pkg install location + # - relative to the running python (sys.executable) + # - homebrew + # - macports + # - system libraries + # look in salts pkg install location. lib = glob.glob("/opt/salt/lib/libcrypto.dylib") @@ -43,6 +48,17 @@ def _find_libcrypto(): # onedir file lib = lib or glob.glob("lib/libcrypto.dylib") + # Look in the location relative to the python binary + # Try to account for this being a venv by resolving the path if it is a + # symlink + py_bin = sys.executable + if os.path.islink(py_bin): + py_bin = os.path.realpath(py_bin) + target = os.path.dirname(py_bin) + if os.path.basename(target) == "bin": + target = os.path.dirname(target) + lib = lib or glob.glob(f"{target}/lib/libcrypto.dylib") + # Find library symlinks in Homebrew locations. brew_prefix = os.getenv("HOMEBREW_PREFIX", "/usr/local") lib = lib or glob.glob( From 6645801eee064b6b7d925a1b5ccb83fb7b00d2a4 Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Tue, 30 Jan 2024 14:22:29 -0700 Subject: [PATCH 03/96] Add some tests --- salt/utils/rsax931.py | 3 +- tests/pytests/unit/utils/test_rsax931.py | 38 +++++++++++++++++++++++- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/salt/utils/rsax931.py b/salt/utils/rsax931.py index b167e9f211e..05b4c9470a4 100644 --- a/salt/utils/rsax931.py +++ b/salt/utils/rsax931.py @@ -44,8 +44,7 @@ def _find_libcrypto(): lib = glob.glob("/opt/salt/lib/libcrypto.dylib") # look in location salt is running from - # this accounts for running from an unpacked - # onedir file + # this accounts for running from an unpacked onedir file lib = lib or glob.glob("lib/libcrypto.dylib") # Look in the location relative to the python binary diff --git a/tests/pytests/unit/utils/test_rsax931.py b/tests/pytests/unit/utils/test_rsax931.py index a1c81e653f8..0f2b9499bc6 100644 --- a/tests/pytests/unit/utils/test_rsax931.py +++ b/tests/pytests/unit/utils/test_rsax931.py @@ -19,7 +19,7 @@ from salt.utils.rsax931 import ( _find_libcrypto, _load_libcrypto, ) -from tests.support.mock import patch +from tests.support.mock import patch, MagicMock @pytest.fixture @@ -215,6 +215,42 @@ def test_find_libcrypto_darwin_catalina(): assert "/usr/lib/libcrypto.44.dylib" == lib_path +def test_find_libcrypto_darwin_pip_install(): + """ + Test _find_libcrypto on a macOS host where there salt has been installed + into an existing python or virtual environment. + """ + bin_path = "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10" + expected = "/Library/Frameworks/Python.framework/Versions/3.10/lib/libcrypto.dylib" + glob_effect = ([], [], ["yay"], [], [], [], []) + with patch("salt.utils.platform.is_darwin", lambda: True),\ + patch("sys.executable", bin_path),\ + patch("os.path.islink", return_value=False),\ + patch.object(glob, "glob", side_effect=glob_effect) as mock_glob: + lib_path = _find_libcrypto() + assert lib_path == "yay" + mock_glob.assert_any_call(expected) + + +def test_find_libcrypto_darwin_pip_install_venv(): + """ + Test _find_libcrypto on a macOS host where there salt has been installed + into an existing python or virtual environment. + """ + src_path = "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10" + lnk_path = "/Users/bill/src/salt/venv/bin/python" + expected = "/Library/Frameworks/Python.framework/Versions/3.10/lib/libcrypto.dylib" + glob_effect = ([], [], ["yay"], [], [], [], []) + with patch("salt.utils.platform.is_darwin", lambda: True), \ + patch("sys.executable", lnk_path), \ + patch("os.path.islink", return_value=True), \ + patch("os.path.realpath", return_value=src_path), \ + patch.object(glob, "glob", side_effect=glob_effect) as mock_glob: + lib_path = _find_libcrypto() + assert lib_path == "yay" + mock_glob.assert_any_call(expected) + + def test_find_libcrypto_darwin_bigsur_packaged(): """ Test _find_libcrypto on a Darwin-like macOS host where there isn't a From 4157fe7ed01842222456c34490588a4d5dfef9c4 Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Tue, 30 Jan 2024 15:38:33 -0700 Subject: [PATCH 04/96] Add changelog --- changelog/65954.fixed.md | 1 + salt/utils/rsax931.py | 1 - tests/pytests/unit/utils/test_rsax931.py | 26 ++++++++++++++---------- 3 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 changelog/65954.fixed.md diff --git a/changelog/65954.fixed.md b/changelog/65954.fixed.md new file mode 100644 index 00000000000..113d603e005 --- /dev/null +++ b/changelog/65954.fixed.md @@ -0,0 +1 @@ +Fixed issue where Salt can't find libcrypto when pip installed from a cloned repo diff --git a/salt/utils/rsax931.py b/salt/utils/rsax931.py index 05b4c9470a4..350655c56f7 100644 --- a/salt/utils/rsax931.py +++ b/salt/utils/rsax931.py @@ -2,7 +2,6 @@ Create and verify ANSI X9.31 RSA signatures using OpenSSL libcrypto """ - import ctypes.util import glob import os diff --git a/tests/pytests/unit/utils/test_rsax931.py b/tests/pytests/unit/utils/test_rsax931.py index 0f2b9499bc6..39bdb7cac30 100644 --- a/tests/pytests/unit/utils/test_rsax931.py +++ b/tests/pytests/unit/utils/test_rsax931.py @@ -1,7 +1,6 @@ """ Test the RSA ANSI X9.31 signer and verifier """ - import ctypes import ctypes.util import fnmatch @@ -19,7 +18,7 @@ from salt.utils.rsax931 import ( _find_libcrypto, _load_libcrypto, ) -from tests.support.mock import patch, MagicMock +from tests.support.mock import patch @pytest.fixture @@ -215,6 +214,7 @@ def test_find_libcrypto_darwin_catalina(): assert "/usr/lib/libcrypto.44.dylib" == lib_path +@pytest.mark.skip_unless_on_darwin def test_find_libcrypto_darwin_pip_install(): """ Test _find_libcrypto on a macOS host where there salt has been installed @@ -223,15 +223,17 @@ def test_find_libcrypto_darwin_pip_install(): bin_path = "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10" expected = "/Library/Frameworks/Python.framework/Versions/3.10/lib/libcrypto.dylib" glob_effect = ([], [], ["yay"], [], [], [], []) - with patch("salt.utils.platform.is_darwin", lambda: True),\ - patch("sys.executable", bin_path),\ - patch("os.path.islink", return_value=False),\ - patch.object(glob, "glob", side_effect=glob_effect) as mock_glob: + with patch("salt.utils.platform.is_darwin", lambda: True), patch( + "sys.executable", bin_path + ), patch("os.path.islink", return_value=False), patch.object( + glob, "glob", side_effect=glob_effect + ) as mock_glob: lib_path = _find_libcrypto() assert lib_path == "yay" mock_glob.assert_any_call(expected) +@pytest.mark.skip_unless_on_darwin def test_find_libcrypto_darwin_pip_install_venv(): """ Test _find_libcrypto on a macOS host where there salt has been installed @@ -241,11 +243,13 @@ def test_find_libcrypto_darwin_pip_install_venv(): lnk_path = "/Users/bill/src/salt/venv/bin/python" expected = "/Library/Frameworks/Python.framework/Versions/3.10/lib/libcrypto.dylib" glob_effect = ([], [], ["yay"], [], [], [], []) - with patch("salt.utils.platform.is_darwin", lambda: True), \ - patch("sys.executable", lnk_path), \ - patch("os.path.islink", return_value=True), \ - patch("os.path.realpath", return_value=src_path), \ - patch.object(glob, "glob", side_effect=glob_effect) as mock_glob: + with patch("salt.utils.platform.is_darwin", lambda: True), patch( + "sys.executable", lnk_path + ), patch("os.path.islink", return_value=True), patch( + "os.path.realpath", return_value=src_path + ), patch.object( + glob, "glob", side_effect=glob_effect + ) as mock_glob: lib_path = _find_libcrypto() assert lib_path == "yay" mock_glob.assert_any_call(expected) From 2368341eca428a5666e1f19c58365e680e1b7a1d Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Fri, 2 Feb 2024 08:30:05 -0700 Subject: [PATCH 05/96] Fix mac_shadow module Fixes an issue with the mac_shadow module where it would fail to retrieve values that weren't set yet... last login for example. Also adds some tests and a changelog --- changelog/34658.fixed.md | 3 + salt/modules/mac_shadow.py | 41 +++++----- tests/pytests/unit/modules/test_mac_shadow.py | 77 +++++++++++++++++++ 3 files changed, 103 insertions(+), 18 deletions(-) create mode 100644 changelog/34658.fixed.md create mode 100644 tests/pytests/unit/modules/test_mac_shadow.py diff --git a/changelog/34658.fixed.md b/changelog/34658.fixed.md new file mode 100644 index 00000000000..1152b41d2df --- /dev/null +++ b/changelog/34658.fixed.md @@ -0,0 +1,3 @@ +Fix an issue with mac_shadow that was causing a command execution error when +retrieving values that were not yet set. For example, retrieving last login +before the user had logged in. diff --git a/salt/modules/mac_shadow.py b/salt/modules/mac_shadow.py index 0ae1bf1c1bf..1825d44cd98 100644 --- a/salt/modules/mac_shadow.py +++ b/salt/modules/mac_shadow.py @@ -202,11 +202,12 @@ def get_account_created(name): salt '*' shadow.get_account_created admin """ - ret = _get_account_policy_data_value(name, "creationTime") - - unix_timestamp = salt.utils.mac_utils.parse_return(ret) - - date_text = _convert_to_datetime(unix_timestamp) + try: + ret = _get_account_policy_data_value(name, "creationTime") + unix_timestamp = salt.utils.mac_utils.parse_return(ret) + date_text = _convert_to_datetime(unix_timestamp) + except CommandExecutionError: + date_text = "0" return date_text @@ -228,11 +229,12 @@ def get_last_change(name): salt '*' shadow.get_last_change admin """ - ret = _get_account_policy_data_value(name, "passwordLastSetTime") - - unix_timestamp = salt.utils.mac_utils.parse_return(ret) - - date_text = _convert_to_datetime(unix_timestamp) + try: + ret = _get_account_policy_data_value(name, "passwordLastSetTime") + unix_timestamp = salt.utils.mac_utils.parse_return(ret) + date_text = _convert_to_datetime(unix_timestamp) + except CommandExecutionError: + date_text = "0" return date_text @@ -254,9 +256,11 @@ def get_login_failed_count(name): salt '*' shadow.get_login_failed_count admin """ - ret = _get_account_policy_data_value(name, "failedLoginCount") - - return salt.utils.mac_utils.parse_return(ret) + try: + ret = _get_account_policy_data_value(name, "failedLoginCount") + return salt.utils.mac_utils.parse_return(ret) + except CommandExecutionError: + return "0" def get_login_failed_last(name): @@ -277,11 +281,12 @@ def get_login_failed_last(name): salt '*' shadow.get_login_failed_last admin """ - ret = _get_account_policy_data_value(name, "failedLoginTimestamp") - - unix_timestamp = salt.utils.mac_utils.parse_return(ret) - - date_text = _convert_to_datetime(unix_timestamp) + try: + ret = _get_account_policy_data_value(name, "failedLoginTimestamp") + unix_timestamp = salt.utils.mac_utils.parse_return(ret) + date_text = _convert_to_datetime(unix_timestamp) + except CommandExecutionError: + date_text = "0" return date_text diff --git a/tests/pytests/unit/modules/test_mac_shadow.py b/tests/pytests/unit/modules/test_mac_shadow.py new file mode 100644 index 00000000000..a23514e785a --- /dev/null +++ b/tests/pytests/unit/modules/test_mac_shadow.py @@ -0,0 +1,77 @@ +""" +Unit Tests for the mac_desktop execution module. +""" + +import pytest + +import salt.modules.mac_shadow as mac_shadow +from salt.exceptions import CommandExecutionError +from tests.support.mock import patch + +pytestmark = [ + pytest.mark.skip_unless_on_darwin, +] + + +def test_get_account_created(): + with patch.object(mac_shadow, "_get_account_policy_data_value", return_value="0"): + result = mac_shadow.get_account_created("junk") + expected = "1969-12-31 17:00:00" + assert result == expected + + +def test_get_account_created_error(): + with patch.object( + mac_shadow, "_get_account_policy_data_value", side_effect=CommandExecutionError + ): + result = mac_shadow.get_account_created("junk") + expected = "0" + assert result == expected + + +def test_get_last_change(): + with patch.object(mac_shadow, "_get_account_policy_data_value", return_value="0"): + result = mac_shadow.get_last_change("junk") + expected = "1969-12-31 17:00:00" + assert result == expected + + +def test_get_last_change_error(): + with patch.object( + mac_shadow, "_get_account_policy_data_value", side_effect=CommandExecutionError + ): + result = mac_shadow.get_last_change("junk") + expected = "0" + assert result == expected + + +def test_login_failed_count(): + with patch.object(mac_shadow, "_get_account_policy_data_value", return_value="0"): + result = mac_shadow.get_login_failed_count("junk") + expected = "0" + assert result == expected + + +def test_get_login_failed_count_error(): + with patch.object( + mac_shadow, "_get_account_policy_data_value", side_effect=CommandExecutionError + ): + result = mac_shadow.get_login_failed_count("junk") + expected = "0" + assert result == expected + + +def test_login_failed_last(): + with patch.object(mac_shadow, "_get_account_policy_data_value", return_value="0"): + result = mac_shadow.get_login_failed_last("junk") + expected = "1969-12-31 17:00:00" + assert result == expected + + +def test_get_login_failed_last_error(): + with patch.object( + mac_shadow, "_get_account_policy_data_value", side_effect=CommandExecutionError + ): + result = mac_shadow.get_login_failed_last("junk") + expected = "0" + assert result == expected From da2bf5ccd49f11735b5b09f9c5a7aef647c6296f Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Fri, 2 Feb 2024 10:21:32 -0700 Subject: [PATCH 06/96] Only catch error when value not found --- salt/modules/mac_shadow.py | 49 +++++++------ tests/pytests/unit/modules/test_mac_shadow.py | 68 +++++++++++++++---- 2 files changed, 86 insertions(+), 31 deletions(-) diff --git a/salt/modules/mac_shadow.py b/salt/modules/mac_shadow.py index 1825d44cd98..e8f9195555c 100644 --- a/salt/modules/mac_shadow.py +++ b/salt/modules/mac_shadow.py @@ -113,7 +113,9 @@ def _get_account_policy_data_value(name, key): ret = salt.utils.mac_utils.execute_return_result(cmd) except CommandExecutionError as exc: if "eDSUnknownNodeName" in exc.strerror: - raise CommandExecutionError("User not found: {}".format(name)) + raise CommandExecutionError(f"User not found: {name}") + if "eDSUnknownMatchType" in exc.strerror: + raise CommandExecutionError(f"Value not found: {key}") raise CommandExecutionError("Unknown error: {}".format(exc.strerror)) return ret @@ -204,12 +206,14 @@ def get_account_created(name): """ try: ret = _get_account_policy_data_value(name, "creationTime") - unix_timestamp = salt.utils.mac_utils.parse_return(ret) - date_text = _convert_to_datetime(unix_timestamp) - except CommandExecutionError: - date_text = "0" + except CommandExecutionError as exc: + if "Value not found" in exc.message: + return 0 + else: + raise - return date_text + unix_timestamp = salt.utils.mac_utils.parse_return(ret) + return _convert_to_datetime(unix_timestamp) def get_last_change(name): @@ -231,12 +235,14 @@ def get_last_change(name): """ try: ret = _get_account_policy_data_value(name, "passwordLastSetTime") - unix_timestamp = salt.utils.mac_utils.parse_return(ret) - date_text = _convert_to_datetime(unix_timestamp) - except CommandExecutionError: - date_text = "0" + except CommandExecutionError as exc: + if "Value not found" in exc.message: + return 0 + else: + raise - return date_text + unix_timestamp = salt.utils.mac_utils.parse_return(ret) + return _convert_to_datetime(unix_timestamp) def get_login_failed_count(name): @@ -258,9 +264,12 @@ def get_login_failed_count(name): """ try: ret = _get_account_policy_data_value(name, "failedLoginCount") - return salt.utils.mac_utils.parse_return(ret) - except CommandExecutionError: - return "0" + except CommandExecutionError as exc: + if "Value not found" in exc.message: + return 0 + else: + raise + return salt.utils.mac_utils.parse_return(ret) def get_login_failed_last(name): @@ -283,12 +292,14 @@ def get_login_failed_last(name): """ try: ret = _get_account_policy_data_value(name, "failedLoginTimestamp") - unix_timestamp = salt.utils.mac_utils.parse_return(ret) - date_text = _convert_to_datetime(unix_timestamp) - except CommandExecutionError: - date_text = "0" + except CommandExecutionError as exc: + if "Value not found" in exc.message: + return 0 + else: + raise - return date_text + unix_timestamp = salt.utils.mac_utils.parse_return(ret) + return _convert_to_datetime(unix_timestamp) def set_maxdays(name, days): diff --git a/tests/pytests/unit/modules/test_mac_shadow.py b/tests/pytests/unit/modules/test_mac_shadow.py index a23514e785a..db1234effc6 100644 --- a/tests/pytests/unit/modules/test_mac_shadow.py +++ b/tests/pytests/unit/modules/test_mac_shadow.py @@ -20,15 +20,26 @@ def test_get_account_created(): assert result == expected -def test_get_account_created_error(): +def test_get_account_created_no_value(): with patch.object( - mac_shadow, "_get_account_policy_data_value", side_effect=CommandExecutionError + mac_shadow, + "_get_account_policy_data_value", + side_effect=CommandExecutionError("Value not found: creationTime"), ): result = mac_shadow.get_account_created("junk") - expected = "0" + expected = 0 assert result == expected +def test_get_account_created_error(): + with patch.object( + mac_shadow, + "_get_account_policy_data_value", + side_effect=CommandExecutionError("Unknown error: something happened"), + ), pytest.raises(CommandExecutionError): + mac_shadow.get_account_created("junk") + + def test_get_last_change(): with patch.object(mac_shadow, "_get_account_policy_data_value", return_value="0"): result = mac_shadow.get_last_change("junk") @@ -36,15 +47,26 @@ def test_get_last_change(): assert result == expected -def test_get_last_change_error(): +def test_get_last_change_no_value(): with patch.object( - mac_shadow, "_get_account_policy_data_value", side_effect=CommandExecutionError + mac_shadow, + "_get_account_policy_data_value", + side_effect=CommandExecutionError("Value not found: creationTime"), ): result = mac_shadow.get_last_change("junk") - expected = "0" + expected = 0 assert result == expected +def test_get_last_change_error(): + with patch.object( + mac_shadow, + "_get_account_policy_data_value", + side_effect=CommandExecutionError("Unknown error: something happened"), + ), pytest.raises(CommandExecutionError): + mac_shadow.get_last_change("junk") + + def test_login_failed_count(): with patch.object(mac_shadow, "_get_account_policy_data_value", return_value="0"): result = mac_shadow.get_login_failed_count("junk") @@ -52,15 +74,26 @@ def test_login_failed_count(): assert result == expected -def test_get_login_failed_count_error(): +def test_get_login_failed_count_no_value(): with patch.object( - mac_shadow, "_get_account_policy_data_value", side_effect=CommandExecutionError + mac_shadow, + "_get_account_policy_data_value", + side_effect=CommandExecutionError("Value not found: creationTime"), ): result = mac_shadow.get_login_failed_count("junk") - expected = "0" + expected = 0 assert result == expected +def test_get_login_failed_count_error(): + with patch.object( + mac_shadow, + "_get_account_policy_data_value", + side_effect=CommandExecutionError("Unknown error: something happened"), + ), pytest.raises(CommandExecutionError): + mac_shadow.get_login_failed_count("junk") + + def test_login_failed_last(): with patch.object(mac_shadow, "_get_account_policy_data_value", return_value="0"): result = mac_shadow.get_login_failed_last("junk") @@ -68,10 +101,21 @@ def test_login_failed_last(): assert result == expected -def test_get_login_failed_last_error(): +def test_get_login_failed_last_no_value(): with patch.object( - mac_shadow, "_get_account_policy_data_value", side_effect=CommandExecutionError + mac_shadow, + "_get_account_policy_data_value", + side_effect=CommandExecutionError("Value not found: creationTime"), ): result = mac_shadow.get_login_failed_last("junk") - expected = "0" + expected = 0 assert result == expected + + +def test_get_login_failed_last_error(): + with patch.object( + mac_shadow, + "_get_account_policy_data_value", + side_effect=CommandExecutionError("Unknown error: something happened"), + ), pytest.raises(CommandExecutionError): + mac_shadow.get_login_failed_last("junk") From b1b0c37871ce3f94b680f0ac09a0574c190623a9 Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Fri, 2 Feb 2024 10:31:41 -0700 Subject: [PATCH 07/96] Update function docs --- salt/modules/mac_shadow.py | 21 ++++++++------ tests/pytests/unit/modules/test_mac_shadow.py | 29 ++++++++++--------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/salt/modules/mac_shadow.py b/salt/modules/mac_shadow.py index e8f9195555c..e5c23332ea5 100644 --- a/salt/modules/mac_shadow.py +++ b/salt/modules/mac_shadow.py @@ -193,7 +193,8 @@ def get_account_created(name): :param str name: The username of the account - :return: The date/time the account was created (yyyy-mm-dd hh:mm:ss) + :return: The date/time the account was created (yyyy-mm-dd hh:mm:ss) or 0 if + the value is not defined :rtype: str :raises: CommandExecutionError on user not found or any other unknown error @@ -208,7 +209,7 @@ def get_account_created(name): ret = _get_account_policy_data_value(name, "creationTime") except CommandExecutionError as exc: if "Value not found" in exc.message: - return 0 + return "0" else: raise @@ -222,7 +223,8 @@ def get_last_change(name): :param str name: The username of the account - :return: The date/time the account was modified (yyyy-mm-dd hh:mm:ss) + :return: The date/time the account was modified (yyyy-mm-dd hh:mm:ss) or 0 + if the value is not defined :rtype: str :raises: CommandExecutionError on user not found or any other unknown error @@ -237,7 +239,7 @@ def get_last_change(name): ret = _get_account_policy_data_value(name, "passwordLastSetTime") except CommandExecutionError as exc: if "Value not found" in exc.message: - return 0 + return "0" else: raise @@ -251,8 +253,9 @@ def get_login_failed_count(name): :param str name: The username of the account - :return: The number of failed login attempts - :rtype: int + :return: The number of failed login attempts. 0 may mean there are no failed + login attempts or the value is not defined + :rtype: str :raises: CommandExecutionError on user not found or any other unknown error @@ -266,7 +269,7 @@ def get_login_failed_count(name): ret = _get_account_policy_data_value(name, "failedLoginCount") except CommandExecutionError as exc: if "Value not found" in exc.message: - return 0 + return "0" else: raise return salt.utils.mac_utils.parse_return(ret) @@ -279,7 +282,7 @@ def get_login_failed_last(name): :param str name: The username of the account :return: The date/time of the last failed login attempt on this account - (yyyy-mm-dd hh:mm:ss) + (yyyy-mm-dd hh:mm:ss) or 0 if the value is not defined :rtype: str :raises: CommandExecutionError on user not found or any other unknown error @@ -294,7 +297,7 @@ def get_login_failed_last(name): ret = _get_account_policy_data_value(name, "failedLoginTimestamp") except CommandExecutionError as exc: if "Value not found" in exc.message: - return 0 + return "0" else: raise diff --git a/tests/pytests/unit/modules/test_mac_shadow.py b/tests/pytests/unit/modules/test_mac_shadow.py index db1234effc6..fa294b6651d 100644 --- a/tests/pytests/unit/modules/test_mac_shadow.py +++ b/tests/pytests/unit/modules/test_mac_shadow.py @@ -1,6 +1,7 @@ """ Unit Tests for the mac_desktop execution module. """ +from datetime import datetime import pytest @@ -13,11 +14,15 @@ pytestmark = [ ] -def test_get_account_created(): +@pytest.fixture +def zero_date(): + return datetime.fromtimestamp(0).strftime("%Y-%m-%d %H:%M:%S") + + +def test_get_account_created(zero_date): with patch.object(mac_shadow, "_get_account_policy_data_value", return_value="0"): result = mac_shadow.get_account_created("junk") - expected = "1969-12-31 17:00:00" - assert result == expected + assert result == zero_date def test_get_account_created_no_value(): @@ -27,7 +32,7 @@ def test_get_account_created_no_value(): side_effect=CommandExecutionError("Value not found: creationTime"), ): result = mac_shadow.get_account_created("junk") - expected = 0 + expected = "0" assert result == expected @@ -40,11 +45,10 @@ def test_get_account_created_error(): mac_shadow.get_account_created("junk") -def test_get_last_change(): +def test_get_last_change(zero_date): with patch.object(mac_shadow, "_get_account_policy_data_value", return_value="0"): result = mac_shadow.get_last_change("junk") - expected = "1969-12-31 17:00:00" - assert result == expected + assert result == zero_date def test_get_last_change_no_value(): @@ -54,7 +58,7 @@ def test_get_last_change_no_value(): side_effect=CommandExecutionError("Value not found: creationTime"), ): result = mac_shadow.get_last_change("junk") - expected = 0 + expected = "0" assert result == expected @@ -81,7 +85,7 @@ def test_get_login_failed_count_no_value(): side_effect=CommandExecutionError("Value not found: creationTime"), ): result = mac_shadow.get_login_failed_count("junk") - expected = 0 + expected = "0" assert result == expected @@ -94,11 +98,10 @@ def test_get_login_failed_count_error(): mac_shadow.get_login_failed_count("junk") -def test_login_failed_last(): +def test_login_failed_last(zero_date): with patch.object(mac_shadow, "_get_account_policy_data_value", return_value="0"): result = mac_shadow.get_login_failed_last("junk") - expected = "1969-12-31 17:00:00" - assert result == expected + assert result == zero_date def test_get_login_failed_last_no_value(): @@ -108,7 +111,7 @@ def test_get_login_failed_last_no_value(): side_effect=CommandExecutionError("Value not found: creationTime"), ): result = mac_shadow.get_login_failed_last("junk") - expected = 0 + expected = "0" assert result == expected From 05688644353453dc9783cdf25a8d52d26aa910dd Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 30 Jan 2024 16:38:39 -0700 Subject: [PATCH 08/96] Ensure channels are closed on connection errors --- salt/channel/client.py | 14 +++++++++--- salt/minion.py | 16 ++++++-------- tests/pytests/unit/test_minion.py | 36 +++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 12 deletions(-) diff --git a/salt/channel/client.py b/salt/channel/client.py index 0ca3cb7b76d..499041d0c73 100644 --- a/salt/channel/client.py +++ b/salt/channel/client.py @@ -594,14 +594,22 @@ class AsyncPubChannel: def _decode_payload(self, payload): # we need to decrypt it log.trace("Decoding payload: %s", payload) + reauth = False if payload["enc"] == "aes": self._verify_master_signature(payload) try: payload["load"] = self.auth.crypticle.loads(payload["load"]) except salt.crypt.AuthenticationError: - yield self.auth.authenticate() - payload["load"] = self.auth.crypticle.loads(payload["load"]) - + reauth = True + if reauth: + try: + yield self.auth.authenticate() + payload["load"] = self.auth.crypticle.loads(payload["load"]) + except salt.crypt.AuthenticationError: + log.error( + "Payload decryption failed even after re-authenticating with master %s", + self.opts["master_ip"], + ) raise salt.ext.tornado.gen.Return(payload) def __enter__(self): diff --git a/salt/minion.py b/salt/minion.py index 15d46b2dacf..c2e15511373 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -1152,17 +1152,20 @@ class MinionManager(MinionBase): self.minions.append(minion) break except SaltClientError as exc: + minion.destroy() failed = True log.error( "Error while bringing up minion for multi-master. Is " - "master at %s responding?", + "master at %s responding? The error message was %s", minion.opts["master"], + exc, ) last = time.time() if auth_wait < self.max_auth_wait: auth_wait += self.auth_wait yield salt.ext.tornado.gen.sleep(auth_wait) # TODO: log? except SaltMasterUnresolvableError: + minion.destroy() err = ( "Master address: '{}' could not be resolved. Invalid or" " unresolveable address. Set 'master' value in minion config.".format( @@ -1172,6 +1175,7 @@ class MinionManager(MinionBase): log.error(err) break except Exception as e: # pylint: disable=broad-except + minion.destroy() failed = True log.critical( "Unexpected error while connecting to %s", @@ -3281,20 +3285,14 @@ class Minion(MinionBase): """ Tear down the minion """ - if self._running is False: - return - self._running = False if hasattr(self, "schedule"): del self.schedule if hasattr(self, "pub_channel") and self.pub_channel is not None: self.pub_channel.on_recv(None) - if hasattr(self.pub_channel, "close"): - self.pub_channel.close() - del self.pub_channel - if hasattr(self, "req_channel") and self.req_channel: + self.pub_channel.close() + if hasattr(self, "req_channel") and self.req_channel is not None: self.req_channel.close() - self.req_channel = None if hasattr(self, "periodic_callbacks"): for cb in self.periodic_callbacks.values(): cb.stop() diff --git a/tests/pytests/unit/test_minion.py b/tests/pytests/unit/test_minion.py index 47eda02b719..6839275ffa3 100644 --- a/tests/pytests/unit/test_minion.py +++ b/tests/pytests/unit/test_minion.py @@ -1119,3 +1119,39 @@ def test_load_args_and_kwargs(minion_opts): _args = [{"max_sleep": 40, "__kwarg__": True}] with pytest.raises(salt.exceptions.SaltInvocationError): ret = salt.minion.load_args_and_kwargs(test_mod.rand_sleep, _args) + + +def test_connect_master_salt_client_error(minion_opts): + """ + Ensure minion's destory method is called on an salt client error while connecting to master. + """ + mm = salt.minion.MinionManager(minion_opts) + minion = salt.minion.Minion(minion_opts) + minion.connect_master = MagicMock(side_effect=SaltClientError) + minion.destroy = MagicMock() + mm._connect_minion(minion) + minion.destroy.assert_called_once() + + +def test_connect_master_unresolveable_error(minion_opts): + """ + Ensure minion's destory method is called on an unresolvable while connecting to master. + """ + mm = salt.minion.MinionManager(minion_opts) + minion = salt.minion.Minion(minion_opts) + minion.connect_master = MagicMock(side_effect=SaltMasterUnresolvableError) + minion.destroy = MagicMock() + mm._connect_minion(minion) + minion.destroy.assert_called_once() + + +def test_connect_master_general_exception_error(minion_opts): + """ + Ensure minion's destory method is called on an un-handled exception while connecting to master. + """ + mm = salt.minion.MinionManager(minion_opts) + minion = salt.minion.Minion(minion_opts) + minion.connect_master = MagicMock(side_effect=Exception) + minion.destroy = MagicMock() + mm._connect_minion(minion) + minion.destroy.assert_called_once() From d5b51912a17df9d7e4f0da83bcb681dd8194374d Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Fri, 2 Feb 2024 14:57:43 -0700 Subject: [PATCH 09/96] Connect master tests need to be coroutines --- salt/transport/zeromq.py | 7 +++- tests/pytests/unit/test_minion.py | 55 +++++++++++++++++++++++++++---- 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/salt/transport/zeromq.py b/salt/transport/zeromq.py index 07f2bc1bf89..703b6ab2cf5 100644 --- a/salt/transport/zeromq.py +++ b/salt/transport/zeromq.py @@ -281,7 +281,12 @@ class PublishClient(salt.transport.base.PublishClient): :param func callback: A function which should be called when data is received """ - return self.stream.on_recv(callback) + try: + return self.stream.on_recv(callback) + except OSError as exc: + if callback is None and str(exc) == "Stream is closed": + return + raise @salt.ext.tornado.gen.coroutine def send(self, msg): diff --git a/tests/pytests/unit/test_minion.py b/tests/pytests/unit/test_minion.py index 6839275ffa3..e5ca73a3f9a 100644 --- a/tests/pytests/unit/test_minion.py +++ b/tests/pytests/unit/test_minion.py @@ -22,6 +22,31 @@ from tests.support.mock import MagicMock, patch log = logging.getLogger(__name__) +@pytest.fixture +def connect_master_mock(): + class ConnectMasterMock: + """ + Mock connect master call. + + The first call will raise an exception stored on the exc attribute. + Subsequent calls will return True. + """ + + def __init__(self): + self.calls = 0 + self.exc = Exception + + @salt.ext.tornado.gen.coroutine + def __call__(self, *args, **kwargs): + self.calls += 1 + if self.calls == 1: + raise self.exc() + else: + return True + + return ConnectMasterMock() + + def test_minion_load_grains_false(minion_opts): """ Minion does not generate grains when load_grains is False @@ -1121,37 +1146,53 @@ def test_load_args_and_kwargs(minion_opts): ret = salt.minion.load_args_and_kwargs(test_mod.rand_sleep, _args) -def test_connect_master_salt_client_error(minion_opts): +async def test_connect_master_salt_client_error(minion_opts, connect_master_mock): """ Ensure minion's destory method is called on an salt client error while connecting to master. """ + minion_opts["acceptance_wait_time"] = 0 mm = salt.minion.MinionManager(minion_opts) minion = salt.minion.Minion(minion_opts) - minion.connect_master = MagicMock(side_effect=SaltClientError) + + connect_master_mock.exc = SaltClientError + minion.connect_master = connect_master_mock minion.destroy = MagicMock() - mm._connect_minion(minion) + await mm._connect_minion(minion) minion.destroy.assert_called_once() + # The first call raised an error which caused minion.destroy to get called, + # the second call is a success. + assert minion.connect_master.calls == 2 -def test_connect_master_unresolveable_error(minion_opts): + +async def test_connect_master_unresolveable_error(minion_opts, connect_master_mock): """ Ensure minion's destory method is called on an unresolvable while connecting to master. """ mm = salt.minion.MinionManager(minion_opts) minion = salt.minion.Minion(minion_opts) - minion.connect_master = MagicMock(side_effect=SaltMasterUnresolvableError) + connect_master_mock.exc = SaltMasterUnresolvableError + minion.connect_master = connect_master_mock minion.destroy = MagicMock() mm._connect_minion(minion) minion.destroy.assert_called_once() + # Unresolvable errors break out of the loop. + assert minion.connect_master.calls == 1 -def test_connect_master_general_exception_error(minion_opts): + +async def test_connect_master_general_exception_error(minion_opts, connect_master_mock): """ Ensure minion's destory method is called on an un-handled exception while connecting to master. """ mm = salt.minion.MinionManager(minion_opts) minion = salt.minion.Minion(minion_opts) - minion.connect_master = MagicMock(side_effect=Exception) + connect_master_mock.exc = Exception + minion.connect_master = connect_master_mock minion.destroy = MagicMock() mm._connect_minion(minion) minion.destroy.assert_called_once() + + # The first call raised an error which caused minion.destroy to get called, + # the second call is a success. + assert minion.connect_master.calls == 2 From 6a88baab8c7d74e367ef497f8c6aed86db26a07e Mon Sep 17 00:00:00 2001 From: vzhestkov Date: Fri, 2 Feb 2024 09:36:07 +0100 Subject: [PATCH 10/96] Remove unused import causing delays on starting salt-master (cherry picked from commit 20573c8941f5908d5acca9e5833bc106342d5036) --- salt/utils/minions.py | 1 - 1 file changed, 1 deletion(-) diff --git a/salt/utils/minions.py b/salt/utils/minions.py index 21d34b7eddd..082b6985225 100644 --- a/salt/utils/minions.py +++ b/salt/utils/minions.py @@ -9,7 +9,6 @@ import logging import os import re -import salt.auth.ldap import salt.cache import salt.payload import salt.roster From bcd236d48c6f4e1f13bbb2f6156bdb99e03fde19 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 6 Feb 2024 06:35:36 +0000 Subject: [PATCH 11/96] Bump to `cryptography==42.0.0` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f --- changelog/66004.security.md | 3 +++ requirements/static/ci/py3.10/cloud.txt | 4 ++-- requirements/static/ci/py3.10/darwin.txt | 4 ++-- requirements/static/ci/py3.10/freebsd.txt | 4 ++-- requirements/static/ci/py3.10/lint.txt | 4 ++-- requirements/static/ci/py3.10/linux.txt | 4 ++-- requirements/static/ci/py3.10/windows.txt | 4 ++-- requirements/static/ci/py3.11/cloud.txt | 4 ++-- requirements/static/ci/py3.11/darwin.txt | 4 ++-- requirements/static/ci/py3.11/freebsd.txt | 4 ++-- requirements/static/ci/py3.11/lint.txt | 4 ++-- requirements/static/ci/py3.11/linux.txt | 4 ++-- requirements/static/ci/py3.11/windows.txt | 4 ++-- requirements/static/ci/py3.12/cloud.txt | 4 ++-- requirements/static/ci/py3.12/darwin.txt | 4 ++-- requirements/static/ci/py3.12/freebsd.txt | 4 ++-- requirements/static/ci/py3.12/lint.txt | 4 ++-- requirements/static/ci/py3.12/linux.txt | 4 ++-- requirements/static/ci/py3.12/windows.txt | 4 ++-- requirements/static/ci/py3.7/cloud.txt | 4 ++-- requirements/static/ci/py3.7/freebsd.txt | 4 ++-- requirements/static/ci/py3.7/lint.txt | 4 ++-- requirements/static/ci/py3.7/linux.txt | 4 ++-- requirements/static/ci/py3.7/windows.txt | 4 ++-- requirements/static/ci/py3.8/cloud.txt | 4 ++-- requirements/static/ci/py3.8/freebsd.txt | 4 ++-- requirements/static/ci/py3.8/lint.txt | 4 ++-- requirements/static/ci/py3.8/linux.txt | 4 ++-- requirements/static/ci/py3.8/windows.txt | 4 ++-- requirements/static/ci/py3.9/cloud.txt | 4 ++-- requirements/static/ci/py3.9/darwin.txt | 4 ++-- requirements/static/ci/py3.9/freebsd.txt | 4 ++-- requirements/static/ci/py3.9/lint.txt | 4 ++-- requirements/static/ci/py3.9/linux.txt | 4 ++-- requirements/static/ci/py3.9/windows.txt | 4 ++-- requirements/static/pkg/linux.in | 2 +- requirements/static/pkg/py3.10/darwin.txt | 4 ++-- requirements/static/pkg/py3.10/freebsd.txt | 4 ++-- requirements/static/pkg/py3.10/linux.txt | 4 ++-- requirements/static/pkg/py3.10/windows.txt | 4 ++-- requirements/static/pkg/py3.11/darwin.txt | 4 ++-- requirements/static/pkg/py3.11/freebsd.txt | 4 ++-- requirements/static/pkg/py3.11/linux.txt | 4 ++-- requirements/static/pkg/py3.11/windows.txt | 4 ++-- requirements/static/pkg/py3.12/darwin.txt | 4 ++-- requirements/static/pkg/py3.12/freebsd.txt | 4 ++-- requirements/static/pkg/py3.12/linux.txt | 4 ++-- requirements/static/pkg/py3.12/windows.txt | 4 ++-- requirements/static/pkg/py3.7/freebsd.txt | 4 ++-- requirements/static/pkg/py3.7/linux.txt | 4 ++-- requirements/static/pkg/py3.7/windows.txt | 4 ++-- requirements/static/pkg/py3.8/freebsd.txt | 4 ++-- requirements/static/pkg/py3.8/linux.txt | 4 ++-- requirements/static/pkg/py3.8/windows.txt | 4 ++-- requirements/static/pkg/py3.9/darwin.txt | 4 ++-- requirements/static/pkg/py3.9/freebsd.txt | 4 ++-- requirements/static/pkg/py3.9/linux.txt | 4 ++-- requirements/static/pkg/py3.9/windows.txt | 4 ++-- 58 files changed, 116 insertions(+), 113 deletions(-) create mode 100644 changelog/66004.security.md diff --git a/changelog/66004.security.md b/changelog/66004.security.md new file mode 100644 index 00000000000..111cdc6136a --- /dev/null +++ b/changelog/66004.security.md @@ -0,0 +1,3 @@ +Bump to ``cryptography==42.0.0`` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f + +In the process, we were also required to update to ``pyOpenSSL==24.0.0`` diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index 73544193c42..2e26f748b10 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -123,7 +123,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.10/linux.txt # -c requirements/static/ci/py3.10/linux.txt @@ -433,7 +433,7 @@ pynacl==1.5.0 # -c requirements/static/ci/py3.10/linux.txt # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.10/linux.txt # -c requirements/static/ci/py3.10/linux.txt diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 3f32008b890..0db7a73df32 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -89,7 +89,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.10/darwin.txt # -r requirements/darwin.txt @@ -311,7 +311,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.10/darwin.txt # -r requirements/darwin.txt diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 68574e3a32f..624670cc487 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -86,7 +86,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.10/freebsd.txt # -r requirements/static/pkg/freebsd.in @@ -304,7 +304,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.10/freebsd.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index 4e053a501bb..d9efc924269 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -134,7 +134,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.10/linux.txt # -c requirements/static/ci/py3.10/linux.txt @@ -448,7 +448,7 @@ pynacl==1.5.0 # -c requirements/static/ci/py3.10/linux.txt # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.10/linux.txt # -c requirements/static/ci/py3.10/linux.txt diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index e48813a9038..747813365d1 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -95,7 +95,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.10/linux.txt # -r requirements/static/pkg/linux.in @@ -321,7 +321,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.10/linux.txt # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 3f62cdfd6a3..0d436a86b00 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -81,7 +81,7 @@ contextvars==2.4 # via # -c requirements/static/ci/../pkg/py3.10/windows.txt # -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.10/windows.txt # -r requirements/windows.txt @@ -293,7 +293,7 @@ pymysql==1.0.2 # -r requirements/windows.txt pynacl==1.5.0 # via -r requirements/static/ci/common.in -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.10/windows.txt # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.11/cloud.txt b/requirements/static/ci/py3.11/cloud.txt index 85a7953dfb7..3538b833491 100644 --- a/requirements/static/ci/py3.11/cloud.txt +++ b/requirements/static/ci/py3.11/cloud.txt @@ -119,7 +119,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.11/linux.txt # -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.11/linux.txt # -c requirements/static/ci/py3.11/linux.txt @@ -405,7 +405,7 @@ pynacl==1.5.0 # -c requirements/static/ci/py3.11/linux.txt # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.11/linux.txt # -c requirements/static/ci/py3.11/linux.txt diff --git a/requirements/static/ci/py3.11/darwin.txt b/requirements/static/ci/py3.11/darwin.txt index 1082b7171cd..ac2598aa27c 100644 --- a/requirements/static/ci/py3.11/darwin.txt +++ b/requirements/static/ci/py3.11/darwin.txt @@ -85,7 +85,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.11/darwin.txt # -r requirements/darwin.txt @@ -286,7 +286,7 @@ pygit2==1.13.1 # via -r requirements/static/ci/darwin.in pynacl==1.5.0 # via -r requirements/static/ci/common.in -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.11/darwin.txt # -r requirements/darwin.txt diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index e2ebbd35d7d..3b0f08b5466 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -84,7 +84,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.11/freebsd.txt # -r requirements/static/pkg/freebsd.in @@ -285,7 +285,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.11/freebsd.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.11/lint.txt b/requirements/static/ci/py3.11/lint.txt index 4c76d5b20f1..809aaf42e34 100644 --- a/requirements/static/ci/py3.11/lint.txt +++ b/requirements/static/ci/py3.11/lint.txt @@ -130,7 +130,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.11/linux.txt # -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.11/linux.txt # -c requirements/static/ci/py3.11/linux.txt @@ -423,7 +423,7 @@ pynacl==1.5.0 # -c requirements/static/ci/py3.11/linux.txt # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.11/linux.txt # -c requirements/static/ci/py3.11/linux.txt diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index adfca9f2384..cbcbe0691f5 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -93,7 +93,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.11/linux.txt # -r requirements/static/pkg/linux.in @@ -302,7 +302,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.11/linux.txt # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index 70227fb36c4..9f36f069ed7 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -79,7 +79,7 @@ contextvars==2.4 # via # -c requirements/static/ci/../pkg/py3.11/windows.txt # -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.11/windows.txt # -r requirements/windows.txt @@ -289,7 +289,7 @@ pymysql==1.0.2 # -r requirements/windows.txt pynacl==1.5.0 # via -r requirements/static/ci/common.in -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.11/windows.txt # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.12/cloud.txt b/requirements/static/ci/py3.12/cloud.txt index 326f1bb2141..baff0486737 100644 --- a/requirements/static/ci/py3.12/cloud.txt +++ b/requirements/static/ci/py3.12/cloud.txt @@ -119,7 +119,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.12/linux.txt # -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt # -c requirements/static/ci/py3.12/linux.txt @@ -405,7 +405,7 @@ pynacl==1.5.0 # -c requirements/static/ci/py3.12/linux.txt # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt # -c requirements/static/ci/py3.12/linux.txt diff --git a/requirements/static/ci/py3.12/darwin.txt b/requirements/static/ci/py3.12/darwin.txt index abe377b038c..01e5031f84f 100644 --- a/requirements/static/ci/py3.12/darwin.txt +++ b/requirements/static/ci/py3.12/darwin.txt @@ -85,7 +85,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.12/darwin.txt # -r requirements/darwin.txt @@ -286,7 +286,7 @@ pygit2==1.13.1 # via -r requirements/static/ci/darwin.in pynacl==1.5.0 # via -r requirements/static/ci/common.in -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.12/darwin.txt # -r requirements/darwin.txt diff --git a/requirements/static/ci/py3.12/freebsd.txt b/requirements/static/ci/py3.12/freebsd.txt index 532be3a78a1..e8ecd33041d 100644 --- a/requirements/static/ci/py3.12/freebsd.txt +++ b/requirements/static/ci/py3.12/freebsd.txt @@ -84,7 +84,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.12/freebsd.txt # -r requirements/static/pkg/freebsd.in @@ -285,7 +285,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.12/freebsd.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.12/lint.txt b/requirements/static/ci/py3.12/lint.txt index c0c5927cfbe..84a6d7531c2 100644 --- a/requirements/static/ci/py3.12/lint.txt +++ b/requirements/static/ci/py3.12/lint.txt @@ -130,7 +130,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.12/linux.txt # -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt # -c requirements/static/ci/py3.12/linux.txt @@ -423,7 +423,7 @@ pynacl==1.5.0 # -c requirements/static/ci/py3.12/linux.txt # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt # -c requirements/static/ci/py3.12/linux.txt diff --git a/requirements/static/ci/py3.12/linux.txt b/requirements/static/ci/py3.12/linux.txt index 5103c4956bb..3bc22ec845d 100644 --- a/requirements/static/ci/py3.12/linux.txt +++ b/requirements/static/ci/py3.12/linux.txt @@ -93,7 +93,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt # -r requirements/static/pkg/linux.in @@ -302,7 +302,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.12/windows.txt b/requirements/static/ci/py3.12/windows.txt index 6b667c63190..123ef228b3e 100644 --- a/requirements/static/ci/py3.12/windows.txt +++ b/requirements/static/ci/py3.12/windows.txt @@ -79,7 +79,7 @@ contextvars==2.4 # via # -c requirements/static/ci/../pkg/py3.12/windows.txt # -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.12/windows.txt # -r requirements/windows.txt @@ -289,7 +289,7 @@ pymysql==1.0.2 # -r requirements/windows.txt pynacl==1.5.0 # via -r requirements/static/ci/common.in -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.12/windows.txt # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index fbe29c8c3e6..ceb1ab28e59 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -137,7 +137,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.7/linux.txt # -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.7/linux.txt # -c requirements/static/ci/py3.7/linux.txt @@ -483,7 +483,7 @@ pynacl==1.5.0 # -c requirements/static/ci/py3.7/linux.txt # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.7/linux.txt # -c requirements/static/ci/py3.7/linux.txt diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 88a3d1914a7..9e5fa6abe24 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -96,7 +96,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.7/freebsd.txt # -r requirements/static/pkg/freebsd.in @@ -344,7 +344,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.7/freebsd.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index fae5c3788a4..1209d4fddec 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -148,7 +148,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.7/linux.txt # -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.7/linux.txt # -c requirements/static/ci/py3.7/linux.txt @@ -493,7 +493,7 @@ pynacl==1.5.0 # -c requirements/static/ci/py3.7/linux.txt # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.7/linux.txt # -c requirements/static/ci/py3.7/linux.txt diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index 5b17d49164e..fa792be8479 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -103,7 +103,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.7/linux.txt # -r requirements/static/pkg/linux.in @@ -356,7 +356,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.7/linux.txt # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index 0a79d8f3144..48a3c7b88f5 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -88,7 +88,7 @@ contextvars==2.4 # via # -c requirements/static/ci/../pkg/py3.7/windows.txt # -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.7/windows.txt # -r requirements/windows.txt @@ -307,7 +307,7 @@ pymysql==1.0.2 # -r requirements/windows.txt pynacl==1.5.0 # via -r requirements/static/ci/common.in -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.7/windows.txt # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 3f817ef0075..9446a0ab2fd 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -132,7 +132,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt # -c requirements/static/ci/py3.8/linux.txt @@ -470,7 +470,7 @@ pynacl==1.5.0 # -c requirements/static/ci/py3.8/linux.txt # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt # -c requirements/static/ci/py3.8/linux.txt diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index e879d25ba5c..f08e563e759 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -91,7 +91,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.8/freebsd.txt # -r requirements/static/pkg/freebsd.in @@ -331,7 +331,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.8/freebsd.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index f708fd610aa..f993a34467f 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -139,7 +139,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt # -c requirements/static/ci/py3.8/linux.txt @@ -478,7 +478,7 @@ pynacl==1.5.0 # -c requirements/static/ci/py3.8/linux.txt # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt # -c requirements/static/ci/py3.8/linux.txt diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 12d29cf02f7..a7ca864214f 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -98,7 +98,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt # -r requirements/static/pkg/linux.in @@ -343,7 +343,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index fd9ab313318..c6147de3cbd 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -83,7 +83,7 @@ contextvars==2.4 # via # -c requirements/static/ci/../pkg/py3.8/windows.txt # -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.8/windows.txt # -r requirements/windows.txt @@ -294,7 +294,7 @@ pymysql==1.0.2 # -r requirements/windows.txt pynacl==1.5.0 # via -r requirements/static/ci/common.in -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.8/windows.txt # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index a9647fa16f3..6a120948bf7 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -132,7 +132,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.9/linux.txt # -c requirements/static/ci/py3.9/linux.txt @@ -472,7 +472,7 @@ pynacl==1.5.0 # -c requirements/static/ci/py3.9/linux.txt # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.9/linux.txt # -c requirements/static/ci/py3.9/linux.txt diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 70e8f14f62d..4b58947462e 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -94,7 +94,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.9/darwin.txt # -r requirements/darwin.txt @@ -340,7 +340,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.9/darwin.txt # -r requirements/darwin.txt diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 936b1488c4f..1a0066b4969 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -91,7 +91,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.9/freebsd.txt # -r requirements/static/pkg/freebsd.in @@ -333,7 +333,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.9/freebsd.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 33302ded997..befefe24901 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -135,7 +135,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.9/linux.txt # -c requirements/static/ci/py3.9/linux.txt @@ -476,7 +476,7 @@ pynacl==1.5.0 # -c requirements/static/ci/py3.9/linux.txt # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.9/linux.txt # -c requirements/static/ci/py3.9/linux.txt diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index b1b23b350bd..96f3b02f5d1 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -96,7 +96,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.9/linux.txt # -r requirements/static/pkg/linux.in @@ -343,7 +343,7 @@ pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.9/linux.txt # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 8abf5a0081d..924d376cc56 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -83,7 +83,7 @@ contextvars==2.4 # via # -c requirements/static/ci/../pkg/py3.9/windows.txt # -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -c requirements/static/ci/../pkg/py3.9/windows.txt # -r requirements/windows.txt @@ -295,7 +295,7 @@ pymysql==1.0.2 # -r requirements/windows.txt pynacl==1.5.0 # via -r requirements/static/ci/common.in -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via # -c requirements/static/ci/../pkg/py3.9/windows.txt # -r requirements/windows.txt diff --git a/requirements/static/pkg/linux.in b/requirements/static/pkg/linux.in index 937c6d3b204..8ee32ad24ba 100644 --- a/requirements/static/pkg/linux.in +++ b/requirements/static/pkg/linux.in @@ -9,4 +9,4 @@ rpm-vercmp setproctitle>=1.2.3 timelib>=0.2.5 importlib-metadata>=3.3.0 -cryptography>=41.0.3 +cryptography>=42.0.0 diff --git a/requirements/static/pkg/py3.10/darwin.txt b/requirements/static/pkg/py3.10/darwin.txt index dd0388e4b9d..ce0d3a58001 100644 --- a/requirements/static/pkg/py3.10/darwin.txt +++ b/requirements/static/pkg/py3.10/darwin.txt @@ -18,7 +18,7 @@ cherrypy==18.6.1 # via -r requirements/darwin.txt contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/darwin.txt # pyopenssl @@ -81,7 +81,7 @@ pycparser==2.21 # cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/darwin.txt python-dateutil==2.8.0 # via -r requirements/darwin.txt diff --git a/requirements/static/pkg/py3.10/freebsd.txt b/requirements/static/pkg/py3.10/freebsd.txt index 3a7ec7bb9e6..38f1cee6c04 100644 --- a/requirements/static/pkg/py3.10/freebsd.txt +++ b/requirements/static/pkg/py3.10/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/static/pkg/freebsd.in # pyopenssl @@ -71,7 +71,7 @@ pycparser==2.21 ; python_version >= "3.9" # cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/static/pkg/freebsd.in python-dateutil==2.8.1 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.10/linux.txt b/requirements/static/pkg/py3.10/linux.txt index d7d35c34cca..3519c80d5c2 100644 --- a/requirements/static/pkg/py3.10/linux.txt +++ b/requirements/static/pkg/py3.10/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/static/pkg/linux.in # pyopenssl @@ -69,7 +69,7 @@ pycparser==2.21 ; python_version >= "3.9" # cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/static/pkg/linux.in python-dateutil==2.8.1 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/pkg/py3.10/windows.txt b/requirements/static/pkg/py3.10/windows.txt index 91651095db3..3e9577ad5ac 100644 --- a/requirements/static/pkg/py3.10/windows.txt +++ b/requirements/static/pkg/py3.10/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/windows.txt # pyopenssl @@ -90,7 +90,7 @@ pymssql==2.2.7 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/windows.txt python-dateutil==2.8.1 # via -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.11/darwin.txt b/requirements/static/pkg/py3.11/darwin.txt index 10080a8dd20..8556418f08c 100644 --- a/requirements/static/pkg/py3.11/darwin.txt +++ b/requirements/static/pkg/py3.11/darwin.txt @@ -18,7 +18,7 @@ cherrypy==18.6.1 # via -r requirements/darwin.txt contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/darwin.txt # pyopenssl @@ -81,7 +81,7 @@ pycparser==2.21 # cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/darwin.txt python-dateutil==2.8.0 # via -r requirements/darwin.txt diff --git a/requirements/static/pkg/py3.11/freebsd.txt b/requirements/static/pkg/py3.11/freebsd.txt index 7ba6d12b104..0b7231fa1bc 100644 --- a/requirements/static/pkg/py3.11/freebsd.txt +++ b/requirements/static/pkg/py3.11/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/static/pkg/freebsd.in # pyopenssl @@ -71,7 +71,7 @@ pycparser==2.21 ; python_version >= "3.9" # cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/static/pkg/freebsd.in python-dateutil==2.8.1 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.11/linux.txt b/requirements/static/pkg/py3.11/linux.txt index 6ea847aafec..941a138d867 100644 --- a/requirements/static/pkg/py3.11/linux.txt +++ b/requirements/static/pkg/py3.11/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/static/pkg/linux.in # pyopenssl @@ -69,7 +69,7 @@ pycparser==2.21 ; python_version >= "3.9" # cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/static/pkg/linux.in python-dateutil==2.8.1 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/pkg/py3.11/windows.txt b/requirements/static/pkg/py3.11/windows.txt index 8e4342a7d0c..4624a4e3c67 100644 --- a/requirements/static/pkg/py3.11/windows.txt +++ b/requirements/static/pkg/py3.11/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/windows.txt # pyopenssl @@ -90,7 +90,7 @@ pymssql==2.2.7 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/windows.txt python-dateutil==2.8.1 # via -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.12/darwin.txt b/requirements/static/pkg/py3.12/darwin.txt index 31c67ce1d6f..fdfa321dda5 100644 --- a/requirements/static/pkg/py3.12/darwin.txt +++ b/requirements/static/pkg/py3.12/darwin.txt @@ -18,7 +18,7 @@ cherrypy==18.6.1 # via -r requirements/darwin.txt contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/darwin.txt # pyopenssl @@ -81,7 +81,7 @@ pycparser==2.21 # cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/darwin.txt python-dateutil==2.8.0 # via -r requirements/darwin.txt diff --git a/requirements/static/pkg/py3.12/freebsd.txt b/requirements/static/pkg/py3.12/freebsd.txt index eb43935ca47..95dfcf9bd0d 100644 --- a/requirements/static/pkg/py3.12/freebsd.txt +++ b/requirements/static/pkg/py3.12/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/static/pkg/freebsd.in # pyopenssl @@ -71,7 +71,7 @@ pycparser==2.21 ; python_version >= "3.9" # cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/static/pkg/freebsd.in python-dateutil==2.8.1 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.12/linux.txt b/requirements/static/pkg/py3.12/linux.txt index 85dd5bbc90e..9d60255b20b 100644 --- a/requirements/static/pkg/py3.12/linux.txt +++ b/requirements/static/pkg/py3.12/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/static/pkg/linux.in # pyopenssl @@ -69,7 +69,7 @@ pycparser==2.21 ; python_version >= "3.9" # cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/static/pkg/linux.in python-dateutil==2.8.1 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/pkg/py3.12/windows.txt b/requirements/static/pkg/py3.12/windows.txt index cc7ba269db1..ec5d62dc6f2 100644 --- a/requirements/static/pkg/py3.12/windows.txt +++ b/requirements/static/pkg/py3.12/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.6 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/windows.txt # pyopenssl @@ -90,7 +90,7 @@ pymssql==2.2.7 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/windows.txt python-dateutil==2.8.1 # via -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.7/freebsd.txt b/requirements/static/pkg/py3.7/freebsd.txt index d26272a0970..3e410b659fd 100644 --- a/requirements/static/pkg/py3.7/freebsd.txt +++ b/requirements/static/pkg/py3.7/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/static/pkg/freebsd.in # pyopenssl @@ -69,7 +69,7 @@ pycparser==2.17 # via cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/static/pkg/freebsd.in python-dateutil==2.8.1 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.7/linux.txt b/requirements/static/pkg/py3.7/linux.txt index 93a2bd79ef8..c362d04ac07 100644 --- a/requirements/static/pkg/py3.7/linux.txt +++ b/requirements/static/pkg/py3.7/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/static/pkg/linux.in # pyopenssl @@ -67,7 +67,7 @@ pycparser==2.17 # via cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/static/pkg/linux.in python-dateutil==2.8.1 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/pkg/py3.7/windows.txt b/requirements/static/pkg/py3.7/windows.txt index c9f733ae702..cc5f5bddf7a 100644 --- a/requirements/static/pkg/py3.7/windows.txt +++ b/requirements/static/pkg/py3.7/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/windows.txt # pyopenssl @@ -90,7 +90,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/windows.txt python-dateutil==2.8.1 # via -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.8/freebsd.txt b/requirements/static/pkg/py3.8/freebsd.txt index 22b6d3049b3..d0206e14572 100644 --- a/requirements/static/pkg/py3.8/freebsd.txt +++ b/requirements/static/pkg/py3.8/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/static/pkg/freebsd.in # pyopenssl @@ -69,7 +69,7 @@ pycparser==2.17 # via cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/static/pkg/freebsd.in python-dateutil==2.8.1 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.8/linux.txt b/requirements/static/pkg/py3.8/linux.txt index a0a72abb801..161fc6c7543 100644 --- a/requirements/static/pkg/py3.8/linux.txt +++ b/requirements/static/pkg/py3.8/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/static/pkg/linux.in # pyopenssl @@ -67,7 +67,7 @@ pycparser==2.17 # via cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/static/pkg/linux.in python-dateutil==2.8.1 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/pkg/py3.8/windows.txt b/requirements/static/pkg/py3.8/windows.txt index 2f1c4e98f06..ec552593ed1 100644 --- a/requirements/static/pkg/py3.8/windows.txt +++ b/requirements/static/pkg/py3.8/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/windows.txt # pyopenssl @@ -90,7 +90,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/windows.txt python-dateutil==2.8.1 # via -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.9/darwin.txt b/requirements/static/pkg/py3.9/darwin.txt index 1d4911b6e01..070233cc5c0 100644 --- a/requirements/static/pkg/py3.9/darwin.txt +++ b/requirements/static/pkg/py3.9/darwin.txt @@ -18,7 +18,7 @@ cherrypy==18.6.1 # via -r requirements/darwin.txt contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/darwin.txt # pyopenssl @@ -81,7 +81,7 @@ pycparser==2.21 # cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/darwin.txt python-dateutil==2.8.0 # via -r requirements/darwin.txt diff --git a/requirements/static/pkg/py3.9/freebsd.txt b/requirements/static/pkg/py3.9/freebsd.txt index 800bb76edac..26a72d973db 100644 --- a/requirements/static/pkg/py3.9/freebsd.txt +++ b/requirements/static/pkg/py3.9/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/static/pkg/freebsd.in # pyopenssl @@ -71,7 +71,7 @@ pycparser==2.21 ; python_version >= "3.9" # cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/static/pkg/freebsd.in python-dateutil==2.8.1 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.9/linux.txt b/requirements/static/pkg/py3.9/linux.txt index c0e0ef4e791..61b55ecfd1d 100644 --- a/requirements/static/pkg/py3.9/linux.txt +++ b/requirements/static/pkg/py3.9/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/static/pkg/linux.in # pyopenssl @@ -69,7 +69,7 @@ pycparser==2.21 ; python_version >= "3.9" # cffi pycryptodomex==3.19.1 # via -r requirements/crypto.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/static/pkg/linux.in python-dateutil==2.8.1 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/pkg/py3.9/windows.txt b/requirements/static/pkg/py3.9/windows.txt index 626ebf5333d..f434e2d766d 100644 --- a/requirements/static/pkg/py3.9/windows.txt +++ b/requirements/static/pkg/py3.9/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.7 +cryptography==42.0.0 # via # -r requirements/windows.txt # pyopenssl @@ -90,7 +90,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.2.0 +pyopenssl==24.0.0 # via -r requirements/windows.txt python-dateutil==2.8.1 # via -r requirements/windows.txt From 4f8f60d89fabd4e72d649954114e82189b9d34d8 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 7 Feb 2024 12:47:32 +0000 Subject: [PATCH 12/96] Run `pyupgrade` against the files modified in the merge-forward --- salt/modules/mac_shadow.py | 42 ++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/salt/modules/mac_shadow.py b/salt/modules/mac_shadow.py index e5c23332ea5..1297971fca2 100644 --- a/salt/modules/mac_shadow.py +++ b/salt/modules/mac_shadow.py @@ -53,13 +53,13 @@ def _get_account_policy(name): :raises: CommandExecutionError on user not found or any other unknown error """ - cmd = "pwpolicy -u {} -getpolicy".format(name) + cmd = f"pwpolicy -u {name} -getpolicy" try: ret = salt.utils.mac_utils.execute_return_result(cmd) except CommandExecutionError as exc: - if "Error: user <{}> not found".format(name) in exc.strerror: - raise CommandExecutionError("User not found: {}".format(name)) - raise CommandExecutionError("Unknown error: {}".format(exc.strerror)) + if f"Error: user <{name}> not found" in exc.strerror: + raise CommandExecutionError(f"User not found: {name}") + raise CommandExecutionError(f"Unknown error: {exc.strerror}") try: policy_list = ret.split("\n")[1].split(" ") @@ -85,14 +85,14 @@ def _set_account_policy(name, policy): :raises: CommandExecutionError on user not found or any other unknown error """ - cmd = 'pwpolicy -u {} -setpolicy "{}"'.format(name, policy) + cmd = f'pwpolicy -u {name} -setpolicy "{policy}"' try: return salt.utils.mac_utils.execute_return_success(cmd) except CommandExecutionError as exc: - if "Error: user <{}> not found".format(name) in exc.strerror: - raise CommandExecutionError("User not found: {}".format(name)) - raise CommandExecutionError("Unknown error: {}".format(exc.strerror)) + if f"Error: user <{name}> not found" in exc.strerror: + raise CommandExecutionError(f"User not found: {name}") + raise CommandExecutionError(f"Unknown error: {exc.strerror}") def _get_account_policy_data_value(name, key): @@ -108,7 +108,7 @@ def _get_account_policy_data_value(name, key): :raises: CommandExecutionError on user not found or any other unknown error """ - cmd = "dscl . -readpl /Users/{} accountPolicyData {}".format(name, key) + cmd = f"dscl . -readpl /Users/{name} accountPolicyData {key}" try: ret = salt.utils.mac_utils.execute_return_result(cmd) except CommandExecutionError as exc: @@ -116,7 +116,7 @@ def _get_account_policy_data_value(name, key): raise CommandExecutionError(f"User not found: {name}") if "eDSUnknownMatchType" in exc.strerror: raise CommandExecutionError(f"Value not found: {key}") - raise CommandExecutionError("Unknown error: {}".format(exc.strerror)) + raise CommandExecutionError(f"Unknown error: {exc.strerror}") return ret @@ -326,7 +326,7 @@ def set_maxdays(name, days): """ minutes = days * 24 * 60 - _set_account_policy(name, "maxMinutesUntilChangePassword={}".format(minutes)) + _set_account_policy(name, f"maxMinutesUntilChangePassword={minutes}") return get_maxdays(name) == days @@ -440,7 +440,7 @@ def set_change(name, date): salt '*' shadow.set_change username 09/21/2016 """ - _set_account_policy(name, "usingExpirationDate=1 expirationDateGMT={}".format(date)) + _set_account_policy(name, f"usingExpirationDate=1 expirationDateGMT={date}") return get_change(name) == date @@ -491,9 +491,7 @@ def set_expire(name, date): salt '*' shadow.set_expire username 07/23/2015 """ - _set_account_policy( - name, "usingHardExpirationDate=1 hardExpireDateGMT={}".format(date) - ) + _set_account_policy(name, f"usingHardExpirationDate=1 hardExpireDateGMT={date}") return get_expire(name) == date @@ -541,16 +539,16 @@ def del_password(name): salt '*' shadow.del_password username """ # This removes the password - cmd = "dscl . -passwd /Users/{} ''".format(name) + cmd = f"dscl . -passwd /Users/{name} ''" try: salt.utils.mac_utils.execute_return_success(cmd) except CommandExecutionError as exc: if "eDSUnknownNodeName" in exc.strerror: - raise CommandExecutionError("User not found: {}".format(name)) - raise CommandExecutionError("Unknown error: {}".format(exc.strerror)) + raise CommandExecutionError(f"User not found: {name}") + raise CommandExecutionError(f"Unknown error: {exc.strerror}") # This is so it looks right in shadow.info - cmd = "dscl . -create /Users/{} Password '*'".format(name) + cmd = f"dscl . -create /Users/{name} Password '*'" salt.utils.mac_utils.execute_return_success(cmd) return info(name)["passwd"] == "*" @@ -577,12 +575,12 @@ def set_password(name, password): salt '*' mac_shadow.set_password macuser macpassword """ - cmd = "dscl . -passwd /Users/{} '{}'".format(name, password) + cmd = f"dscl . -passwd /Users/{name} '{password}'" try: salt.utils.mac_utils.execute_return_success(cmd) except CommandExecutionError as exc: if "eDSUnknownNodeName" in exc.strerror: - raise CommandExecutionError("User not found: {}".format(name)) - raise CommandExecutionError("Unknown error: {}".format(exc.strerror)) + raise CommandExecutionError(f"User not found: {name}") + raise CommandExecutionError(f"Unknown error: {exc.strerror}") return True From 4cade4f59bf3c8bfcd73a969b7aac7d7a9b5b80f Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 7 Feb 2024 12:55:14 +0000 Subject: [PATCH 13/96] Fix missed `salt.ext.tornado` occurrence --- tests/pytests/unit/test_minion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytests/unit/test_minion.py b/tests/pytests/unit/test_minion.py index cd1825c1153..160cb024986 100644 --- a/tests/pytests/unit/test_minion.py +++ b/tests/pytests/unit/test_minion.py @@ -36,7 +36,7 @@ def connect_master_mock(): self.calls = 0 self.exc = Exception - @salt.ext.tornado.gen.coroutine + @tornado.gen.coroutine def __call__(self, *args, **kwargs): self.calls += 1 if self.calls == 1: From c06ae0a9396ec7fa81184fac8776e625fbcedafd Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Mon, 5 Feb 2024 15:11:46 -0700 Subject: [PATCH 14/96] Clean the key when it is read --- salt/channel/server.py | 14 +++---------- salt/crypt.py | 20 ++++++++++++------- .../{channel/test_server.py => test_crypt.py} | 8 +++----- 3 files changed, 19 insertions(+), 23 deletions(-) rename tests/pytests/unit/{channel/test_server.py => test_crypt.py} (80%) diff --git a/salt/channel/server.py b/salt/channel/server.py index 3db243eca17..4d7cd23fc29 100644 --- a/salt/channel/server.py +++ b/salt/channel/server.py @@ -52,10 +52,6 @@ class ReqServerChannel: transport = salt.transport.request_server(opts, **kwargs) return cls(opts, transport) - @staticmethod - def _clean_key(key): - return key.strip().replace("\r", "").replace("\n", "") - def __init__(self, opts, transport): self.opts = opts self.transport = transport @@ -375,7 +371,7 @@ class ReqServerChannel: elif os.path.isfile(pubfn): # The key has been accepted, check it with salt.utils.files.fopen(pubfn, "r") as pubfn_handle: - if self._clean_key(pubfn_handle.read()) != self._clean_key(load["pub"]): + if salt.crypt.clean_key(pubfn_handle.read()) != load["pub"]: log.error( "Authentication attempt from %s failed, the public " "keys did not match. This may be an attempt to compromise " @@ -484,9 +480,7 @@ class ReqServerChannel: # case. Otherwise log the fact that the minion is still # pending. with salt.utils.files.fopen(pubfn_pend, "r") as pubfn_handle: - if self._clean_key(pubfn_handle.read()) != self._clean_key( - load["pub"] - ): + if salt.crypt.clean_key(pubfn_handle.read()) != load["pub"]: log.error( "Authentication attempt from %s failed, the public " "key in pending did not match. This may be an " @@ -542,9 +536,7 @@ class ReqServerChannel: # so, pass on doing anything here, and let it get automatically # accepted below. with salt.utils.files.fopen(pubfn_pend, "r") as pubfn_handle: - if self._clean_key(pubfn_handle.read()) != self._clean_key( - load["pub"] - ): + if salt.crypt.clean_key(pubfn_handle.read()) != load["pub"]: log.error( "Authentication attempt from %s failed, the public " "keys in pending did not match. This may be an " diff --git a/salt/crypt.py b/salt/crypt.py index 067c84200b9..8d656bcf55f 100644 --- a/salt/crypt.py +++ b/salt/crypt.py @@ -80,6 +80,14 @@ if not HAS_M2 and not HAS_CRYPTO: log = logging.getLogger(__name__) +def clean_key(key): + """ + Clean the key so that it only has unix style line endings (\\n) + """ + key = key.strip().split() + return "\n".join(key) + + def dropfile(cachedir, user=None): """ Set an AES dropfile to request the master update the publish session key @@ -377,7 +385,7 @@ class MasterKeys(dict): ) if os.path.isfile(self.sig_path): with salt.utils.files.fopen(self.sig_path) as fp_: - self.pub_signature = fp_.read() + self.pub_signature = clean_key(fp_.read()) log.info( "Read %s's signature from %s", os.path.basename(self.pub_path), @@ -462,7 +470,7 @@ class MasterKeys(dict): with salt.utils.files.fopen(path, "wb+") as wfh: wfh.write(key.publickey().exportKey("PEM")) with salt.utils.files.fopen(path) as rfh: - return rfh.read() + return clean_key(rfh.read()) def get_mkey_paths(self): return self.pub_path, self.rsa_path @@ -942,7 +950,7 @@ class AsyncAuth: except Exception: # pylint: disable=broad-except pass with salt.utils.files.fopen(self.pub_path) as f: - payload["pub"] = f.read() + payload["pub"] = clean_key(f.read()) return payload def decrypt_aes(self, payload, master_pub=True): @@ -1165,11 +1173,9 @@ class AsyncAuth: m_pub_exists = os.path.isfile(m_pub_fn) if m_pub_exists and master_pub and not self.opts["open_mode"]: with salt.utils.files.fopen(m_pub_fn) as fp_: - local_master_pub = fp_.read() + local_master_pub = clean_key(fp_.read()) - if payload["pub_key"].replace("\n", "").replace( - "\r", "" - ) != local_master_pub.replace("\n", "").replace("\r", ""): + if payload["pub_key"] != local_master_pub: if not self.check_auth_deps(payload): return "" diff --git a/tests/pytests/unit/channel/test_server.py b/tests/pytests/unit/test_crypt.py similarity index 80% rename from tests/pytests/unit/channel/test_server.py rename to tests/pytests/unit/test_crypt.py index d50ae416026..d6fd1f3239a 100644 --- a/tests/pytests/unit/channel/test_server.py +++ b/tests/pytests/unit/test_crypt.py @@ -1,6 +1,6 @@ import pytest -import salt.channel.server as server +import salt.crypt as crypt @pytest.fixture @@ -22,8 +22,7 @@ def key_data(): def test__clean_key(key_data, linesep): tst_key = linesep.join(key_data) chk_key = "\n".join(key_data) - clean_func = server.ReqServerChannel._clean_key - assert clean_func(tst_key) == clean_func(chk_key) + assert crypt.clean_key(tst_key) == crypt.clean_key(chk_key) @pytest.mark.parametrize("linesep", ["\r\n", "\r", "\n"]) @@ -31,5 +30,4 @@ def test__clean_key_mismatch(key_data, linesep): tst_key = linesep.join(key_data) tst_key = tst_key.replace("5", "4") chk_key = "\n".join(key_data) - clean_func = server.ReqServerChannel._clean_key - assert clean_func(tst_key) != clean_func(chk_key) + assert crypt.clean_key(tst_key) != crypt.clean_key(chk_key) From 2a486e6d74720fbd29e22781d293196b69c26019 Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Mon, 5 Feb 2024 15:28:23 -0700 Subject: [PATCH 15/96] Combine commands in clean key, don't create a variable --- salt/crypt.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/salt/crypt.py b/salt/crypt.py index 8d656bcf55f..28f05cfd614 100644 --- a/salt/crypt.py +++ b/salt/crypt.py @@ -84,8 +84,7 @@ def clean_key(key): """ Clean the key so that it only has unix style line endings (\\n) """ - key = key.strip().split() - return "\n".join(key) + return "\n".join(key.strip().split()) def dropfile(cachedir, user=None): From 4907eb2a8ccb9657650b101365a3ee008a0bf000 Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Tue, 6 Feb 2024 10:55:20 -0700 Subject: [PATCH 16/96] Use splitlines instead of split --- salt/crypt.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/salt/crypt.py b/salt/crypt.py index 28f05cfd614..5eba9ef5077 100644 --- a/salt/crypt.py +++ b/salt/crypt.py @@ -84,7 +84,7 @@ def clean_key(key): """ Clean the key so that it only has unix style line endings (\\n) """ - return "\n".join(key.strip().split()) + return "\n".join(key.strip().splitlines()) def dropfile(cachedir, user=None): @@ -189,7 +189,7 @@ def _get_key_with_evict(path, timestamp, passphrase): Load a private key from disk. `timestamp` above is intended to be the timestamp of the file's last modification. This fn is memoized so if it is called with the same path and timestamp (the file's last modified time) the - second time the result is returned from the memoiziation. If the file gets + second time the result is returned from the memoization. If the file gets modified then the params are different and the key is loaded from disk. """ log.debug("salt.crypt._get_key_with_evict: Loading private key") @@ -843,11 +843,11 @@ class AsyncAuth: "clean out the keys. The Salt Minion will now exit." ) # Add a random sleep here for systems that are using a - # a service manager to immediately restart the service - # to avoid overloading the system + # service manager to immediately restart the service to + # avoid overloading the system time.sleep(random.randint(10, 20)) sys.exit(salt.defaults.exitcodes.EX_NOPERM) - # has the master returned that its maxed out with minions? + # Has the master returned that it's maxed out with minions? elif payload["ret"] == "full": return "full" else: From 7d6a97e7bafff142a6c0ce6e60f0f5423e95e3e5 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 19 Jan 2024 12:30:24 +0000 Subject: [PATCH 17/96] Timeout all unit tests at 60 seconds(if not running on windows) We have some random test hangs and this will prevent that by forcing the tests to fail in such cases. Windows does not take part of this because it does not support `signal.SIGABRT`, we would have to use threads. Signed-off-by: Pedro Algarvio --- tests/conftest.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index f0d8d71b496..c6d51f6df55 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -445,7 +445,22 @@ def pytest_collection_modifyitems(config, items): from_filenames_collection_modifyitems(config, items) log.warning("Mofifying collected tests to keep track of fixture usage") + + timeout_marker_tests_paths = ( + str(TESTS_DIR / "unit"), + str(PYTESTS_DIR / "unit"), + ) for item in items: + if ( + not salt.utils.platform.is_windows() + and str(pathlib.Path(item.fspath).resolve()).startswith( + timeout_marker_tests_paths + ) + and not item.get_closest_marker("timeout") + ): + # Let's apply the timeout marker on the test, if the marker + # is not already applied + item.add_marker(pytest.mark.timeout(60)) for fixture in item.fixturenames: if fixture not in item._fixtureinfo.name2fixturedefs: continue From 022f73aa7c22f43bb969fd45ac77e2c0826eac3a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 23 Jan 2024 06:47:15 +0000 Subject: [PATCH 18/96] Migrate `tests/unit/states/test_pip_state.py::PipStateInstallationErrorTest::test_importable_installation_error` to pytest Signed-off-by: Pedro Algarvio --- .../integration/states/test_pip_state.py | 75 +++++++++++++++ tests/unit/states/test_pip_state.py | 96 +------------------ 2 files changed, 78 insertions(+), 93 deletions(-) create mode 100644 tests/pytests/integration/states/test_pip_state.py diff --git a/tests/pytests/integration/states/test_pip_state.py b/tests/pytests/integration/states/test_pip_state.py new file mode 100644 index 00000000000..ed3dca22298 --- /dev/null +++ b/tests/pytests/integration/states/test_pip_state.py @@ -0,0 +1,75 @@ +import subprocess + +import pytest + +import salt.version +from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES +from tests.support.helpers import VirtualEnv, dedent + +pytestmark = [ + pytest.mark.skip_if_binaries_missing(*KNOWN_BINARY_NAMES, check_all=False), + pytest.mark.requires_network, +] + + +@pytest.fixture(scope="module") +def _extra_requirements(): + extra_requirements = [] + for name, version in salt.version.dependency_information(): + if name in ["PyYAML", "packaging", "looseversion"]: + extra_requirements.append(f"{name}=={version}") + return extra_requirements + + +@pytest.mark.slow_test +@pytest.mark.parametrize( + "pip_contraint", + [ + # Latest pip 18 + "<19.0", + # Latest pip 19 + "<20.0", + # Latest pip 20 + "<21.0", + # Latest pip + None, + ], +) +def test_importable_installation_error(_extra_requirements, pip_contraint): + code = dedent( + """\ + import sys + import traceback + try: + import salt.states.pip_state + salt.states.pip_state.InstallationError + except ImportError as exc: + traceback.print_exc(file=sys.stdout) + sys.stdout.flush() + sys.exit(1) + except AttributeError as exc: + traceback.print_exc(file=sys.stdout) + sys.stdout.flush() + sys.exit(2) + except Exception as exc: + traceback.print_exc(exc, file=sys.stdout) + sys.stdout.flush() + sys.exit(3) + sys.exit(0) + """ + ) + with VirtualEnv() as venv: + venv.install(*_extra_requirements) + if pip_contraint: + venv.install(f"pip{pip_contraint}") + try: + subprocess.check_output([venv.venv_python, "-c", code]) + except subprocess.CalledProcessError as exc: + if exc.returncode == 1: + pytest.fail(f"Failed to import pip:\n{exc.output}") + elif exc.returncode == 2: + pytest.fail( + f"Failed to import InstallationError from pip:\n{exc.output}" + ) + else: + pytest.fail(exc.output) diff --git a/tests/unit/states/test_pip_state.py b/tests/unit/states/test_pip_state.py index dbac7b926e6..444c332776d 100644 --- a/tests/unit/states/test_pip_state.py +++ b/tests/unit/states/test_pip_state.py @@ -1,11 +1,5 @@ -""" -tests.unit.states.pip_test -~~~~~~~~~~~~~~~~~~~~~~~~~~ -""" - import logging import os -import subprocess import sys import pytest @@ -13,27 +7,18 @@ import pytest import salt.states.pip_state as pip_state import salt.utils.path import salt.version -from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES -from tests.support.helpers import VirtualEnv, dedent from tests.support.mixins import LoaderModuleMockMixin, SaltReturnAssertsMixin from tests.support.mock import MagicMock, patch from tests.support.runtests import RUNTIME_VARS from tests.support.unit import TestCase -try: - import pip - - HAS_PIP = True -except ImportError: - HAS_PIP = False - +pip = pytest.importorskip( + "pip", reason="The 'pip' library is not importable(installed system-wide)" +) log = logging.getLogger(__name__) -@pytest.mark.skipif( - not HAS_PIP, reason="The 'pip' library is not importable(installed system-wide)" -) class PipStateTest(TestCase, SaltReturnAssertsMixin, LoaderModuleMockMixin): def setup_loader_modules(self): return { @@ -422,78 +407,3 @@ class PipStateUtilsTest(TestCase): mock_modules.pop("pip", None) with patch("sys.modules", mock_modules): pip_state.purge_pip() - - -@pytest.mark.skip_if_binaries_missing(*KNOWN_BINARY_NAMES, check_all=False) -@pytest.mark.requires_network -class PipStateInstallationErrorTest(TestCase): - @pytest.mark.slow_test - def test_importable_installation_error(self): - extra_requirements = [] - for name, version in salt.version.dependency_information(): - if name in ["PyYAML", "packaging", "looseversion"]: - extra_requirements.append(f"{name}=={version}") - failures = {} - pip_version_requirements = [ - # Latest pip 18 - "<19.0", - # Latest pip 19 - "<20.0", - # Latest pip 20 - "<21.0", - # Latest pip - None, - ] - code = dedent( - """\ - import sys - import traceback - try: - import salt.states.pip_state - salt.states.pip_state.InstallationError - except ImportError as exc: - traceback.print_exc(file=sys.stdout) - sys.stdout.flush() - sys.exit(1) - except AttributeError as exc: - traceback.print_exc(file=sys.stdout) - sys.stdout.flush() - sys.exit(2) - except Exception as exc: - traceback.print_exc(exc, file=sys.stdout) - sys.stdout.flush() - sys.exit(3) - sys.exit(0) - """ - ) - for requirement in list(pip_version_requirements): - try: - with VirtualEnv() as venv: - venv.install(*extra_requirements) - if requirement: - venv.install(f"pip{requirement}") - try: - subprocess.check_output([venv.venv_python, "-c", code]) - except subprocess.CalledProcessError as exc: - if exc.returncode == 1: - failures[requirement] = "Failed to import pip:\n{}".format( - exc.output - ) - elif exc.returncode == 2: - failures[ - requirement - ] = "Failed to import InstallationError from pip:\n{}".format( - exc.output - ) - else: - failures[requirement] = exc.output - except Exception as exc: # pylint: disable=broad-except - failures[requirement] = str(exc) - if failures: - errors = "" - for requirement, exception in failures.items(): - errors += "pip{}: {}\n\n".format(requirement or "", exception) - self.fail( - "Failed to get InstallationError exception under at least one pip" - " version:\n{}".format(errors) - ) From 5d96fdcad236f35be3591ad05e6ba2738022c8d2 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 22 Jan 2024 17:58:48 +0000 Subject: [PATCH 19/96] All tests except `tests/pytests/{scenarios,pkg}` timeout at 60 seconds Signed-off-by: Pedro Algarvio --- tests/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index c6d51f6df55..6c37958294b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -447,13 +447,13 @@ def pytest_collection_modifyitems(config, items): log.warning("Mofifying collected tests to keep track of fixture usage") timeout_marker_tests_paths = ( - str(TESTS_DIR / "unit"), - str(PYTESTS_DIR / "unit"), + str(PYTESTS_DIR / "pkg"), + str(PYTESTS_DIR / "scenarios"), ) for item in items: if ( not salt.utils.platform.is_windows() - and str(pathlib.Path(item.fspath).resolve()).startswith( + and not str(pathlib.Path(item.fspath).resolve()).startswith( timeout_marker_tests_paths ) and not item.get_closest_marker("timeout") From 67a0e99bff9d568b3c3c5bc70f9b5962fd68ac8a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 23 Jan 2024 06:48:08 +0000 Subject: [PATCH 20/96] Increase timeout on some slower tests Signed-off-by: Pedro Algarvio --- tests/integration/loader/test_ext_modules.py | 12 +----------- tests/integration/spm/test_build.py | 1 + tests/pytests/functional/loader/test_loader.py | 1 + .../pytests/functional/modules/test_mac_brew_pkg.py | 1 + tests/pytests/functional/modules/test_mac_pkgutil.py | 1 + tests/pytests/functional/states/test_npm.py | 1 + tests/pytests/functional/states/test_pkg.py | 1 + .../pytests/integration/cli/test_salt_deltaproxy.py | 3 +-- tests/pytests/integration/cli/test_syndic_eauth.py | 1 + .../integration/modules/grains/test_append.py | 1 + tests/pytests/integration/netapi/test_ssh_client.py | 1 + tests/pytests/integration/reactor/test_reactor.py | 1 + tests/unit/utils/test_gitfs.py | 2 ++ 13 files changed, 14 insertions(+), 13 deletions(-) diff --git a/tests/integration/loader/test_ext_modules.py b/tests/integration/loader/test_ext_modules.py index bc57f6b5d7e..5c98cd8f322 100644 --- a/tests/integration/loader/test_ext_modules.py +++ b/tests/integration/loader/test_ext_modules.py @@ -1,14 +1,3 @@ -""" - :codeauthor: Pedro Algarvio (pedro@algarvio.me) - - - integration.loader.ext_modules - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Test Salt's loader regarding external overrides -""" - - import os import time @@ -24,6 +13,7 @@ class LoaderOverridesTest(ModuleCase): self.run_function("saltutil.sync_modules") @pytest.mark.slow_test + @pytest.mark.timeout(120) def test_overridden_internal(self): # To avoid a race condition on Windows, we need to make sure the # `override_test.py` file is present in the _modules directory before diff --git a/tests/integration/spm/test_build.py b/tests/integration/spm/test_build.py index 653b51864c9..2352a78a5de 100644 --- a/tests/integration/spm/test_build.py +++ b/tests/integration/spm/test_build.py @@ -36,6 +36,7 @@ class SPMBuildTest(SPMCase, ModuleCase): @pytest.mark.skip_if_binaries_missing("fallocate") @pytest.mark.slow_test + @pytest.mark.timeout(120) def test_spm_build_big_file(self): """ test spm build with a big file diff --git a/tests/pytests/functional/loader/test_loader.py b/tests/pytests/functional/loader/test_loader.py index 33b6bd793d3..bae8fd3dc4e 100644 --- a/tests/pytests/functional/loader/test_loader.py +++ b/tests/pytests/functional/loader/test_loader.py @@ -9,6 +9,7 @@ from tests.support.pytest.helpers import FakeSaltExtension pytestmark = [ # These are slow because they create a virtualenv and install salt in it pytest.mark.slow_test, + pytest.mark.timeout(120), ] diff --git a/tests/pytests/functional/modules/test_mac_brew_pkg.py b/tests/pytests/functional/modules/test_mac_brew_pkg.py index ae6fe9971bf..1582e7eea35 100644 --- a/tests/pytests/functional/modules/test_mac_brew_pkg.py +++ b/tests/pytests/functional/modules/test_mac_brew_pkg.py @@ -49,6 +49,7 @@ def pkg_2_name(pkg): pkg.remove(pkg_name) +@pytest.mark.timeout(120) def test_brew_install(pkg, pkg_1_name): """ Tests the installation of packages diff --git a/tests/pytests/functional/modules/test_mac_pkgutil.py b/tests/pytests/functional/modules/test_mac_pkgutil.py index 02bb2e5641f..397bb895871 100644 --- a/tests/pytests/functional/modules/test_mac_pkgutil.py +++ b/tests/pytests/functional/modules/test_mac_pkgutil.py @@ -8,6 +8,7 @@ import pytest from salt.exceptions import SaltInvocationError pytestmark = [ + pytest.mark.timeout(120), pytest.mark.slow_test, pytest.mark.destructive_test, pytest.mark.skip_if_not_root, diff --git a/tests/pytests/functional/states/test_npm.py b/tests/pytests/functional/states/test_npm.py index 2899b7985a1..130609209aa 100644 --- a/tests/pytests/functional/states/test_npm.py +++ b/tests/pytests/functional/states/test_npm.py @@ -55,6 +55,7 @@ def npm(states, modules, apply_gitconfig_workaround): @pytest.mark.skip_if_not_root +@pytest.mark.timeout(120) def test_removed_installed_cycle(npm, modules): project_version = "pm2@5.1.0" success = modules.npm.uninstall("pm2") diff --git a/tests/pytests/functional/states/test_pkg.py b/tests/pytests/functional/states/test_pkg.py index c63dfb2784f..63c5729ad87 100644 --- a/tests/pytests/functional/states/test_pkg.py +++ b/tests/pytests/functional/states/test_pkg.py @@ -19,6 +19,7 @@ pytestmark = [ pytest.mark.slow_test, pytest.mark.skip_if_not_root, pytest.mark.destructive_test, + pytest.mark.timeout(120), ] diff --git a/tests/pytests/integration/cli/test_salt_deltaproxy.py b/tests/pytests/integration/cli/test_salt_deltaproxy.py index 59071a2d6fa..4eae897a3ca 100644 --- a/tests/pytests/integration/cli/test_salt_deltaproxy.py +++ b/tests/pytests/integration/cli/test_salt_deltaproxy.py @@ -464,7 +464,6 @@ def test_custom_proxy_module( salt_cli, proxy_minion_id, parallel_startup, - integration_files_dir, ): """ Ensure the salt-proxy control proxy starts and @@ -593,12 +592,12 @@ def ping(): [True, False], ids=["parallel_startup=True", "parallel_startup=False"], ) +@pytest.mark.timeout(120) def test_custom_proxy_module_raise_exception( salt_master, salt_cli, proxy_minion_id, parallel_startup, - integration_files_dir, ): """ Ensure the salt-proxy control proxy starts and diff --git a/tests/pytests/integration/cli/test_syndic_eauth.py b/tests/pytests/integration/cli/test_syndic_eauth.py index 3fa4033ec5a..2b36cbb17c9 100644 --- a/tests/pytests/integration/cli/test_syndic_eauth.py +++ b/tests/pytests/integration/cli/test_syndic_eauth.py @@ -12,6 +12,7 @@ docker = pytest.importorskip("docker") pytestmark = [ pytest.mark.core_test, + pytest.mark.timeout(120), ] diff --git a/tests/pytests/integration/modules/grains/test_append.py b/tests/pytests/integration/modules/grains/test_append.py index 4123d885612..b4451bd2bc5 100644 --- a/tests/pytests/integration/modules/grains/test_append.py +++ b/tests/pytests/integration/modules/grains/test_append.py @@ -106,6 +106,7 @@ def test_grains_append_val_is_list(salt_call_cli, append_grain): assert ret.data == {append_grain.key: [append_grain.value, second_grain]} +@pytest.mark.timeout(120) def test_grains_remove_add( salt_call_cli, append_grain, wait_for_pillar_refresh_complete ): diff --git a/tests/pytests/integration/netapi/test_ssh_client.py b/tests/pytests/integration/netapi/test_ssh_client.py index 42db6d0eacd..20e3852ddd9 100644 --- a/tests/pytests/integration/netapi/test_ssh_client.py +++ b/tests/pytests/integration/netapi/test_ssh_client.py @@ -135,6 +135,7 @@ def test_ssh_disabled(client, auth_creds): assert ret is None +@pytest.mark.timeout(120) def test_shell_inject_ssh_priv( client, salt_ssh_roster_file, rosters_dir, tmp_path, salt_auto_account ): diff --git a/tests/pytests/integration/reactor/test_reactor.py b/tests/pytests/integration/reactor/test_reactor.py index 0c73d282a71..33bfb7a278e 100644 --- a/tests/pytests/integration/reactor/test_reactor.py +++ b/tests/pytests/integration/reactor/test_reactor.py @@ -104,6 +104,7 @@ def test_reactor_reaction( @pytest.mark.skip_on_windows(reason=PRE_PYTEST_SKIP_REASON) +@pytest.mark.timeout(120) def test_reactor_is_leader( event_listener, salt_master, diff --git a/tests/unit/utils/test_gitfs.py b/tests/unit/utils/test_gitfs.py index 259ea056fcd..46ae9f2a39a 100644 --- a/tests/unit/utils/test_gitfs.py +++ b/tests/unit/utils/test_gitfs.py @@ -145,6 +145,7 @@ class TestGitBase(TestCase, AdaptedConfigurationTestCaseMixin): provider._master_lock.release() @pytest.mark.slow_test + @pytest.mark.timeout(120) def test_git_provider_mp_lock_timeout(self): """ Check that lock will time out if master lock is locked. @@ -159,6 +160,7 @@ class TestGitBase(TestCase, AdaptedConfigurationTestCaseMixin): provider._master_lock.release() @pytest.mark.slow_test + @pytest.mark.timeout(120) def test_git_provider_mp_clear_lock_timeout(self): """ Check that clear lock will time out if master lock is locked. From 5f63d785e9c8502dd22116f3517bfe71ff958db6 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 23 Jan 2024 07:00:32 +0000 Subject: [PATCH 21/96] Switch to a custom `timeout_unless_on_windows` marker Signed-off-by: Pedro Algarvio --- tests/conftest.py | 33 +++++++++++++------ tests/integration/loader/test_ext_modules.py | 2 +- tests/integration/spm/test_build.py | 2 +- .../pytests/functional/loader/test_loader.py | 2 +- tests/pytests/functional/states/test_npm.py | 2 +- tests/pytests/functional/states/test_pkg.py | 2 +- .../integration/cli/test_salt_deltaproxy.py | 2 +- .../integration/cli/test_syndic_eauth.py | 2 +- .../integration/modules/grains/test_append.py | 2 +- .../integration/netapi/test_ssh_client.py | 2 +- .../integration/reactor/test_reactor.py | 2 +- tests/unit/utils/test_gitfs.py | 4 +-- 12 files changed, 35 insertions(+), 22 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 6c37958294b..598d492b706 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -338,6 +338,11 @@ def pytest_configure(config): "when called returns `True`. If `skip` is a callable, it should accept a single argument " "'grains', which is the grains dictionary.", ) + config.addinivalue_line( + "markers", + "timeout_unless_on_windows(*args, **kwargs): Apply the 'timeout' marker unless running " + "on Windows.", + ) # "Flag" the slowTest decorator if we're skipping slow tests or not os.environ["SLOW_TESTS"] = str(config.getoption("--run-slow")) @@ -451,16 +456,24 @@ def pytest_collection_modifyitems(config, items): str(PYTESTS_DIR / "scenarios"), ) for item in items: - if ( - not salt.utils.platform.is_windows() - and not str(pathlib.Path(item.fspath).resolve()).startswith( - timeout_marker_tests_paths - ) - and not item.get_closest_marker("timeout") - ): - # Let's apply the timeout marker on the test, if the marker - # is not already applied - item.add_marker(pytest.mark.timeout(60)) + marker = item.get_closest_marker("timeout_unless_on_windows") + if marker is not None: + if not salt.utils.platform.is_windows(): + # Apply the marker since we're not on windows + item.add_marker( + pytest.mark.timeout(*marker.args, **marker.kwargs.copy()) + ) + else: + if ( + not salt.utils.platform.is_windows() + and not str(pathlib.Path(item.fspath).resolve()).startswith( + timeout_marker_tests_paths + ) + and not item.get_closest_marker("timeout") + ): + # Let's apply the timeout marker on the test, if the marker + # is not already applied + item.add_marker(pytest.mark.timeout(60)) for fixture in item.fixturenames: if fixture not in item._fixtureinfo.name2fixturedefs: continue diff --git a/tests/integration/loader/test_ext_modules.py b/tests/integration/loader/test_ext_modules.py index 5c98cd8f322..cd30b4af2e1 100644 --- a/tests/integration/loader/test_ext_modules.py +++ b/tests/integration/loader/test_ext_modules.py @@ -13,7 +13,7 @@ class LoaderOverridesTest(ModuleCase): self.run_function("saltutil.sync_modules") @pytest.mark.slow_test - @pytest.mark.timeout(120) + @pytest.mark.timeout_unless_on_windows(120) def test_overridden_internal(self): # To avoid a race condition on Windows, we need to make sure the # `override_test.py` file is present in the _modules directory before diff --git a/tests/integration/spm/test_build.py b/tests/integration/spm/test_build.py index 2352a78a5de..6828db9d753 100644 --- a/tests/integration/spm/test_build.py +++ b/tests/integration/spm/test_build.py @@ -36,7 +36,7 @@ class SPMBuildTest(SPMCase, ModuleCase): @pytest.mark.skip_if_binaries_missing("fallocate") @pytest.mark.slow_test - @pytest.mark.timeout(120) + @pytest.mark.timeout_unless_on_windows(120) def test_spm_build_big_file(self): """ test spm build with a big file diff --git a/tests/pytests/functional/loader/test_loader.py b/tests/pytests/functional/loader/test_loader.py index bae8fd3dc4e..00c16708e8f 100644 --- a/tests/pytests/functional/loader/test_loader.py +++ b/tests/pytests/functional/loader/test_loader.py @@ -9,7 +9,7 @@ from tests.support.pytest.helpers import FakeSaltExtension pytestmark = [ # These are slow because they create a virtualenv and install salt in it pytest.mark.slow_test, - pytest.mark.timeout(120), + pytest.mark.timeout_unless_on_windows(120), ] diff --git a/tests/pytests/functional/states/test_npm.py b/tests/pytests/functional/states/test_npm.py index 130609209aa..500bd274498 100644 --- a/tests/pytests/functional/states/test_npm.py +++ b/tests/pytests/functional/states/test_npm.py @@ -55,7 +55,7 @@ def npm(states, modules, apply_gitconfig_workaround): @pytest.mark.skip_if_not_root -@pytest.mark.timeout(120) +@pytest.mark.timeout_unless_on_windows(120) def test_removed_installed_cycle(npm, modules): project_version = "pm2@5.1.0" success = modules.npm.uninstall("pm2") diff --git a/tests/pytests/functional/states/test_pkg.py b/tests/pytests/functional/states/test_pkg.py index 63c5729ad87..746b25f4502 100644 --- a/tests/pytests/functional/states/test_pkg.py +++ b/tests/pytests/functional/states/test_pkg.py @@ -19,7 +19,7 @@ pytestmark = [ pytest.mark.slow_test, pytest.mark.skip_if_not_root, pytest.mark.destructive_test, - pytest.mark.timeout(120), + pytest.mark.timeout_unless_on_windows(120), ] diff --git a/tests/pytests/integration/cli/test_salt_deltaproxy.py b/tests/pytests/integration/cli/test_salt_deltaproxy.py index 4eae897a3ca..13ee95fee72 100644 --- a/tests/pytests/integration/cli/test_salt_deltaproxy.py +++ b/tests/pytests/integration/cli/test_salt_deltaproxy.py @@ -592,7 +592,7 @@ def ping(): [True, False], ids=["parallel_startup=True", "parallel_startup=False"], ) -@pytest.mark.timeout(120) +@pytest.mark.timeout_unless_on_windows(120) def test_custom_proxy_module_raise_exception( salt_master, salt_cli, diff --git a/tests/pytests/integration/cli/test_syndic_eauth.py b/tests/pytests/integration/cli/test_syndic_eauth.py index 2b36cbb17c9..e65d9cad16a 100644 --- a/tests/pytests/integration/cli/test_syndic_eauth.py +++ b/tests/pytests/integration/cli/test_syndic_eauth.py @@ -12,7 +12,7 @@ docker = pytest.importorskip("docker") pytestmark = [ pytest.mark.core_test, - pytest.mark.timeout(120), + pytest.mark.timeout_unless_on_windows(120), ] diff --git a/tests/pytests/integration/modules/grains/test_append.py b/tests/pytests/integration/modules/grains/test_append.py index b4451bd2bc5..0fb54393f3e 100644 --- a/tests/pytests/integration/modules/grains/test_append.py +++ b/tests/pytests/integration/modules/grains/test_append.py @@ -106,7 +106,7 @@ def test_grains_append_val_is_list(salt_call_cli, append_grain): assert ret.data == {append_grain.key: [append_grain.value, second_grain]} -@pytest.mark.timeout(120) +@pytest.mark.timeout_unless_on_windows(120) def test_grains_remove_add( salt_call_cli, append_grain, wait_for_pillar_refresh_complete ): diff --git a/tests/pytests/integration/netapi/test_ssh_client.py b/tests/pytests/integration/netapi/test_ssh_client.py index 20e3852ddd9..199658642d6 100644 --- a/tests/pytests/integration/netapi/test_ssh_client.py +++ b/tests/pytests/integration/netapi/test_ssh_client.py @@ -135,7 +135,7 @@ def test_ssh_disabled(client, auth_creds): assert ret is None -@pytest.mark.timeout(120) +@pytest.mark.timeout_unless_on_windows(120) def test_shell_inject_ssh_priv( client, salt_ssh_roster_file, rosters_dir, tmp_path, salt_auto_account ): diff --git a/tests/pytests/integration/reactor/test_reactor.py b/tests/pytests/integration/reactor/test_reactor.py index 33bfb7a278e..957e17876e3 100644 --- a/tests/pytests/integration/reactor/test_reactor.py +++ b/tests/pytests/integration/reactor/test_reactor.py @@ -104,7 +104,7 @@ def test_reactor_reaction( @pytest.mark.skip_on_windows(reason=PRE_PYTEST_SKIP_REASON) -@pytest.mark.timeout(120) +@pytest.mark.timeout_unless_on_windows(120) def test_reactor_is_leader( event_listener, salt_master, diff --git a/tests/unit/utils/test_gitfs.py b/tests/unit/utils/test_gitfs.py index 46ae9f2a39a..e72f94050c8 100644 --- a/tests/unit/utils/test_gitfs.py +++ b/tests/unit/utils/test_gitfs.py @@ -145,7 +145,7 @@ class TestGitBase(TestCase, AdaptedConfigurationTestCaseMixin): provider._master_lock.release() @pytest.mark.slow_test - @pytest.mark.timeout(120) + @pytest.mark.timeout_unless_on_windows(120) def test_git_provider_mp_lock_timeout(self): """ Check that lock will time out if master lock is locked. @@ -160,7 +160,7 @@ class TestGitBase(TestCase, AdaptedConfigurationTestCaseMixin): provider._master_lock.release() @pytest.mark.slow_test - @pytest.mark.timeout(120) + @pytest.mark.timeout_unless_on_windows(120) def test_git_provider_mp_clear_lock_timeout(self): """ Check that clear lock will time out if master lock is locked. From 8b762be8adf261238edecce1c9a43c2d400bc670 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 23 Jan 2024 19:21:59 +0000 Subject: [PATCH 22/96] Decomplicate the eauth tests Signed-off-by: Pedro Algarvio --- .../integration/cli/test_syndic_eauth.py | 233 ++++++++---------- 1 file changed, 101 insertions(+), 132 deletions(-) diff --git a/tests/pytests/integration/cli/test_syndic_eauth.py b/tests/pytests/integration/cli/test_syndic_eauth.py index e65d9cad16a..07908629683 100644 --- a/tests/pytests/integration/cli/test_syndic_eauth.py +++ b/tests/pytests/integration/cli/test_syndic_eauth.py @@ -1,6 +1,5 @@ import json -import pathlib -import tempfile +import logging import time import pytest @@ -9,17 +8,18 @@ from tests.conftest import CODE_DIR docker = pytest.importorskip("docker") +log = logging.getLogger(__name__) pytestmark = [ pytest.mark.core_test, - pytest.mark.timeout_unless_on_windows(120), + pytest.mark.timeout_unless_on_windows(600, func_only=True), ] def json_output_to_dict(output): - """ + r""" Convert ``salt ... --out=json`` Syndic return to a dictionary. Since the - --out=json will return several JSON outputs, e.g. {...}\\n{...}, we have to + --out=json will return several JSON outputs, e.g. {...}\n{...}, we have to parse that output individually. """ output = output or "" @@ -36,20 +36,6 @@ def json_output_to_dict(output): return results -def accept_keys(container, required_minions): - failure_time = time.time() + 20 - while time.time() < failure_time: - container.run("salt-key -Ay") - res = container.run("salt-key -L --out=json") - if ( - isinstance(res.data, dict) - and set(res.data.get("minions")) == required_minions - ): - break - else: - pytest.skip(f"{container} unable to accept keys for {required_minions}") - - @pytest.fixture(scope="module") def syndic_network(): try: @@ -73,56 +59,49 @@ def syndic_network(): network.remove() -@pytest.fixture(scope="module") -def source_path(): - return str(CODE_DIR / "salt") - - @pytest.fixture(scope="module") def container_image_name(): - return "ghcr.io/saltstack/salt-ci-containers/salt:3005" + return "ghcr.io/saltstack/salt-ci-containers/salt:3006" @pytest.fixture(scope="module") def container_python_version(): - return "3.7" + return "3.10" @pytest.fixture(scope="module") -def config(source_path): - # 3.10>= will allow the below line - # with tempfile.TemporaryDirectory(ignore_cleanup_errors=True) as tmp_path: - with tempfile.TemporaryDirectory() as tmp_path: - tmp_path = pathlib.Path(tmp_path) - master_dir = tmp_path / "master" - minion_dir = tmp_path / "minion" - syndic_a_dir = tmp_path / "syndic_a" - syndic_b_dir = tmp_path / "syndic_b" - minion_a1_dir = tmp_path / "minion_a1" - minion_a2_dir = tmp_path / "minion_a2" - minion_b1_dir = tmp_path / "minion_b1" - minion_b2_dir = tmp_path / "minion_b2" +def config(tmp_path_factory): + tmp_path = tmp_path_factory.mktemp("eauth") + master_dir = tmp_path / "master" + minion_dir = tmp_path / "minion" + syndic_a_dir = tmp_path / "syndic_a" + syndic_b_dir = tmp_path / "syndic_b" + minion_a1_dir = tmp_path / "minion_a1" + minion_a2_dir = tmp_path / "minion_a2" + minion_b1_dir = tmp_path / "minion_b1" + minion_b2_dir = tmp_path / "minion_b2" - for dir_ in ( - master_dir, - minion_dir, - syndic_a_dir, - syndic_b_dir, - minion_a1_dir, - minion_a2_dir, - minion_b1_dir, - minion_b2_dir, - ): - dir_.mkdir(parents=True, exist_ok=True) - (dir_ / "master.d").mkdir(exist_ok=True) - # minion.d is probably needed to prevent errors on tempdir cleanup - (dir_ / "minion.d").mkdir(exist_ok=True) - (dir_ / "pki").mkdir(exist_ok=True) - (master_dir / "master.d").mkdir(exist_ok=True) + for dir_ in ( + master_dir, + minion_dir, + syndic_a_dir, + syndic_b_dir, + minion_a1_dir, + minion_a2_dir, + minion_b1_dir, + minion_b2_dir, + ): + dir_.mkdir(parents=True, exist_ok=True) + (dir_ / "master.d").mkdir(exist_ok=True) + # minion.d is probably needed to prevent errors on tempdir cleanup + (dir_ / "minion.d").mkdir(exist_ok=True) + (dir_ / "pki").mkdir(exist_ok=True) + (master_dir / "master.d").mkdir(exist_ok=True) - master_config_path = master_dir / "master" - master_config_path.write_text( - """ + master_config_path = master_dir / "master" + master_config_path.write_text( + """ +open_mode: True auth.pam.python: /usr/local/bin/python3 order_masters: True @@ -143,17 +122,20 @@ nodegroups: second_string: "minion_*2" b_string: "minion_b*" + """ + ) + + minion_config_path = minion_dir / "minion" + minion_config_path.write_text("id: minion\nmaster: master\nopen_mode: True") + + syndic_a_minion_config_path = syndic_a_dir / "minion" + syndic_a_minion_config_path.write_text( + "id: syndic_a\nmaster: master\nopen_mode: True" + ) + syndic_a_master_config_path = syndic_a_dir / "master" + syndic_a_master_config_path.write_text( """ - ) - - minion_config_path = minion_dir / "minion" - minion_config_path.write_text("id: minion\nmaster: master") - - syndic_a_minion_config_path = syndic_a_dir / "minion" - syndic_a_minion_config_path.write_text("id: syndic_a\nmaster: master") - syndic_a_master_config_path = syndic_a_dir / "master" - syndic_a_master_config_path.write_text( - """ +open_mode: True auth.pam.python: /usr/local/bin/python3 syndic_master: master publisher_acl: @@ -168,34 +150,36 @@ external_auth: - '*1': - test.* - file.touch - """ - ) + """ + ) - minion_a1_config_path = minion_a1_dir / "minion" - minion_a1_config_path.write_text("id: minion_a1\nmaster: syndic_a") - minion_a2_config_path = minion_a2_dir / "minion" - minion_a2_config_path.write_text("id: minion_a2\nmaster: syndic_a") + minion_a1_config_path = minion_a1_dir / "minion" + minion_a1_config_path.write_text("id: minion_a1\nmaster: syndic_a\nopen_mode: True") + minion_a2_config_path = minion_a2_dir / "minion" + minion_a2_config_path.write_text("id: minion_a2\nmaster: syndic_a\nopen_mode: True") - syndic_b_minion_config_path = syndic_b_dir / "minion" - syndic_b_minion_config_path.write_text("id: syndic_b\nmaster: master") - syndic_b_master_config_path = syndic_b_dir / "master" - syndic_b_master_config_path.write_text("syndic_master: master") + syndic_b_minion_config_path = syndic_b_dir / "minion" + syndic_b_minion_config_path.write_text( + "id: syndic_b\nmaster: master\nopen_mode: True" + ) + syndic_b_master_config_path = syndic_b_dir / "master" + syndic_b_master_config_path.write_text("syndic_master: master\nopen_mode: True") - minion_b1_config_path = minion_b1_dir / "minion" - minion_b1_config_path.write_text("id: minion_b1\nmaster: syndic_b") - minion_b2_config_path = minion_b2_dir / "minion" - minion_b2_config_path.write_text("id: minion_b2\nmaster: syndic_b") + minion_b1_config_path = minion_b1_dir / "minion" + minion_b1_config_path.write_text("id: minion_b1\nmaster: syndic_b\nopen_mode: True") + minion_b2_config_path = minion_b2_dir / "minion" + minion_b2_config_path.write_text("id: minion_b2\nmaster: syndic_b\nopen_mode: True") - yield { - "minion_dir": minion_dir, - "master_dir": master_dir, - "syndic_a_dir": syndic_a_dir, - "syndic_b_dir": syndic_b_dir, - "minion_a1_dir": minion_a1_dir, - "minion_a2_dir": minion_a2_dir, - "minion_b1_dir": minion_b1_dir, - "minion_b2_dir": minion_b2_dir, - } + return { + "minion_dir": minion_dir, + "master_dir": master_dir, + "syndic_a_dir": syndic_a_dir, + "syndic_b_dir": syndic_b_dir, + "minion_a1_dir": minion_a1_dir, + "minion_a2_dir": minion_a2_dir, + "minion_b1_dir": minion_b1_dir, + "minion_b2_dir": minion_b2_dir, + } @pytest.fixture(scope="module") @@ -203,7 +187,6 @@ def docker_master( salt_factories, syndic_network, config, - source_path, container_image_name, container_python_version, ): @@ -217,7 +200,7 @@ def docker_master( "network": syndic_network, "volumes": { config_dir: {"bind": "/etc/salt", "mode": "z"}, - source_path: { + str(CODE_DIR / "salt"): { "bind": f"/usr/local/lib/python{container_python_version}/site-packages/salt/", "mode": "z", }, @@ -242,7 +225,6 @@ def docker_minion( salt_factories, syndic_network, config, - source_path, container_image_name, container_python_version, ): @@ -256,7 +238,7 @@ def docker_minion( "network": syndic_network, "volumes": { config_dir: {"bind": "/etc/salt", "mode": "z"}, - source_path: { + str(CODE_DIR / "salt"): { "bind": f"/usr/local/lib/python{container_python_version}/site-packages/salt/", "mode": "z", }, @@ -276,7 +258,6 @@ def docker_syndic_a( salt_factories, config, syndic_network, - source_path, container_image_name, container_python_version, ): @@ -290,7 +271,7 @@ def docker_syndic_a( "network": syndic_network, "volumes": { config_dir: {"bind": "/etc/salt", "mode": "z"}, - source_path: { + str(CODE_DIR / "salt"): { "bind": f"/usr/local/lib/python{container_python_version}/site-packages/salt/", "mode": "z", }, @@ -310,7 +291,6 @@ def docker_syndic_b( salt_factories, config, syndic_network, - source_path, container_image_name, container_python_version, ): @@ -324,7 +304,7 @@ def docker_syndic_b( "network": syndic_network, "volumes": { config_dir: {"bind": "/etc/salt", "mode": "z"}, - source_path: { + str(CODE_DIR / "salt"): { "bind": f"/usr/local/lib/python{container_python_version}/site-packages/salt/", "mode": "z", }, @@ -344,7 +324,6 @@ def docker_minion_a1( salt_factories, config, syndic_network, - source_path, container_image_name, container_python_version, ): @@ -358,7 +337,7 @@ def docker_minion_a1( "entrypoint": "python -m http.server", "volumes": { config_dir: {"bind": "/etc/salt", "mode": "z"}, - source_path: { + str(CODE_DIR / "salt"): { "bind": f"/usr/local/lib/python{container_python_version}/site-packages/salt/", "mode": "z", }, @@ -378,7 +357,6 @@ def docker_minion_a2( salt_factories, config, syndic_network, - source_path, container_image_name, container_python_version, ): @@ -392,7 +370,7 @@ def docker_minion_a2( "entrypoint": "python -m http.server", "volumes": { config_dir: {"bind": "/etc/salt", "mode": "z"}, - source_path: { + str(CODE_DIR / "salt"): { "bind": f"/usr/local/lib/python{container_python_version}/site-packages/salt/", "mode": "z", }, @@ -412,7 +390,6 @@ def docker_minion_b1( salt_factories, config, syndic_network, - source_path, container_image_name, container_python_version, ): @@ -426,7 +403,7 @@ def docker_minion_b1( "entrypoint": "python -m http.server", "volumes": { config_dir: {"bind": "/etc/salt", "mode": "z"}, - source_path: { + str(CODE_DIR / "salt"): { "bind": f"/usr/local/lib/python{container_python_version}/site-packages/salt/", "mode": "z", }, @@ -446,7 +423,6 @@ def docker_minion_b2( salt_factories, config, syndic_network, - source_path, container_image_name, container_python_version, ): @@ -460,7 +436,7 @@ def docker_minion_b2( "entrypoint": "python -m http.server", "volumes": { config_dir: {"bind": "/etc/salt", "mode": "z"}, - source_path: { + str(CODE_DIR / "salt"): { "bind": f"/usr/local/lib/python{container_python_version}/site-packages/salt/", "mode": "z", }, @@ -512,23 +488,16 @@ def all_the_docker( # END WORKAROUND for s in (docker_syndic_a, docker_syndic_b): s.run("salt-syndic -d") - failure_time = time.time() + 20 - accept_keys( - container=docker_master, required_minions={"minion", "syndic_a", "syndic_b"} - ) - accept_keys( - container=docker_syndic_a, required_minions={"minion_a1", "minion_a2"} - ) - accept_keys( - container=docker_syndic_b, required_minions={"minion_b1", "minion_b2"} - ) - for tries in range(30): - res = docker_master.run(r"salt \* test.ping -t20 --out=json") + failure_time = time.time() + (5 * 60) + results = None + while time.time() < failure_time: + res = docker_master.run(r"salt \* test.ping -t10 --out=json") results = json_output_to_dict(res.stdout) if set(results).issuperset( ["minion", "minion_a1", "minion_a2", "minion_b1", "minion_b2"] ): break + time.sleep(5) else: pytest.skip(f"Missing some minions: {sorted(results)}") @@ -551,10 +520,10 @@ def all_the_docker( # res = container.run('rm -rfv /etc/salt/') # print(container) # print(res.stdout) - except docker.errors.APIError as e: + except docker.errors.APIError as exc: # if the container isn't running, there's not thing we can do # at this point. - print(f"Docker failed removing /etc/salt: {e}") + log.info(f"Docker failed removing /etc/salt: %s", exc) @pytest.fixture( @@ -783,12 +752,12 @@ def test_root_user_should_be_able_to_call_any_and_all_minions_with_any_and_all_c ): target, expected_minions = all_the_minions res = docker_master.run( - f"salt {target} {all_the_commands} -t 20 --out=json", + f"salt {target} {all_the_commands} -t 10 --out=json", ) if "jid does not exist" in (res.stderr or ""): # might be flaky, let's retry res = docker_master.run( - f"salt {target} {all_the_commands} -t 20 --out=json", + f"salt {target} {all_the_commands} -t 10 --out=json", ) results = json_output_to_dict(res.stdout) assert sorted(results) == expected_minions, res.stdout @@ -799,7 +768,7 @@ def test_eauth_user_should_be_able_to_target_valid_minions_with_valid_command( ): target, expected_minions = eauth_valid_minions res = docker_master.run( - f"salt -a pam --username bob --password '' {target} {eauth_valid_commands} {eauth_valid_arguments} -t 20 --out=json", + f"salt -a pam --username bob --password '' {target} {eauth_valid_commands} {eauth_valid_arguments} -t 10 --out=json", ) results = json_output_to_dict(res.stdout) assert sorted(results) == expected_minions, res.stdout @@ -809,7 +778,7 @@ def test_eauth_user_should_not_be_able_to_target_invalid_minions( eauth_blocked_minions, docker_master, docker_minions ): res = docker_master.run( - f"salt -a pam --username bob --password '' {eauth_blocked_minions} file.touch /tmp/bad_bad_file.txt -t 20 --out=json", + f"salt -a pam --username bob --password '' {eauth_blocked_minions} file.touch /tmp/bad_bad_file.txt -t 10 --out=json", ) assert "Authorization error occurred." == res.data or res.data is None for minion in docker_minions: @@ -824,7 +793,7 @@ def test_eauth_user_should_not_be_able_to_target_valid_minions_with_invalid_comm ): tgt, _ = eauth_valid_minions res = docker_master.run( - f"salt -a pam --username bob --password '' {tgt} {eauth_invalid_commands} -t 20 --out=json", + f"salt -a pam --username bob --password '' {tgt} {eauth_invalid_commands} -t 10 --out=json", ) results = json_output_to_dict(res.stdout) assert "Authorization error occurred" in res.stdout @@ -837,7 +806,7 @@ def test_eauth_user_should_not_be_able_to_target_valid_minions_with_valid_comman ): tgt, _ = eauth_valid_minions res = docker_master.run( - f"salt -a pam --username bob --password '' -C '{tgt}' {eauth_valid_commands} {eauth_invalid_arguments} -t 20 --out=json", + f"salt -a pam --username bob --password '' -C '{tgt}' {eauth_valid_commands} {eauth_invalid_arguments} -t 10 --out=json", ) results = json_output_to_dict(res.stdout) assert "Authorization error occurred" in res.stdout @@ -850,7 +819,7 @@ def test_invalid_eauth_user_should_not_be_able_to_do_anything( # TODO: Do we really need to run all of these tests for the invalid user? Maybe not! -W. Werner, 2022-12-01 tgt, _ = eauth_valid_minions res = docker_master.run( - f"salt -a pam --username badguy --password '' -C '{tgt}' {eauth_valid_commands} {eauth_valid_arguments} -t 20 --out=json", + f"salt -a pam --username badguy --password '' -C '{tgt}' {eauth_valid_commands} {eauth_valid_arguments} -t 10 --out=json", ) results = json_output_to_dict(res.stdout) assert sorted(results) == [] @@ -861,7 +830,7 @@ def test_root_should_be_able_to_use_comprehensive_targeting( ): tgt, expected_minions = comprehensive_minion_targeting res = docker_master.run( - f"salt -C '{tgt}' test.version -t 20 --out=json", + f"salt -C '{tgt}' test.version -t 10 --out=json", ) results = json_output_to_dict(res.stdout) assert sorted(results) == expected_minions @@ -872,7 +841,7 @@ def test_eauth_user_should_be_able_to_target_valid_minions_with_valid_commands_c ): tgt, expected_minions = valid_eauth_comprehensive_minion_targeting res = docker_master.run( - f"salt -a pam --username bob --password '' -C '{tgt}' test.version -t 20 --out=json", + f"salt -a pam --username bob --password '' -C '{tgt}' test.version -t 10 --out=json", ) results = json_output_to_dict(res.stdout) assert sorted(results) == expected_minions @@ -882,7 +851,7 @@ def test_eauth_user_with_invalid_comprehensive_targeting_should_auth_failure( invalid_comprehensive_minion_targeting, docker_master ): res = docker_master.run( - f"salt -a pam --username fnord --password '' -C '{invalid_comprehensive_minion_targeting}' test.version -t 20 --out=json", + f"salt -a pam --username fnord --password '' -C '{invalid_comprehensive_minion_targeting}' test.version -t 10 --out=json", ) results = json_output_to_dict(res.stdout) assert "Authorization error occurred" in res.stdout From df6ed810fe4ec40fd07ebc1a68e9d63261a91563 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 24 Jan 2024 07:11:02 +0000 Subject: [PATCH 23/96] Move non functional test to integration tests Signed-off-by: Pedro Algarvio --- .../functional/cli/test_salt_deltaproxy.py | 225 ------------------ .../integration/cli/test_salt_deltaproxy.py | 158 ++++++++++-- 2 files changed, 144 insertions(+), 239 deletions(-) delete mode 100644 tests/pytests/functional/cli/test_salt_deltaproxy.py diff --git a/tests/pytests/functional/cli/test_salt_deltaproxy.py b/tests/pytests/functional/cli/test_salt_deltaproxy.py deleted file mode 100644 index 5bc7604c84a..00000000000 --- a/tests/pytests/functional/cli/test_salt_deltaproxy.py +++ /dev/null @@ -1,225 +0,0 @@ -""" -:codeauthor: Gareth J. Greenaway (ggreenaway@vmware.com) -""" - -import logging -import os -import random - -import pytest -from saltfactories.utils import random_string - -import salt.defaults.exitcodes -from tests.support.helpers import PRE_PYTEST_SKIP_REASON - -log = logging.getLogger(__name__) - - -pytestmark = [ - pytest.mark.skip_on_spawning_platform( - reason="Deltaproxy minions do not currently work on spawning platforms.", - ), - pytest.mark.core_test, -] - - -@pytest.fixture(scope="package") -def salt_master(salt_factories): - config_defaults = { - "open_mode": True, - } - salt_master = salt_factories.salt_master_daemon( - "deltaproxy-functional-master", defaults=config_defaults - ) - with salt_master.started(): - yield salt_master - - -@pytest.fixture(scope="package") -def salt_cli(salt_master): - """ - The ``salt`` CLI as a fixture against the running master - """ - assert salt_master.is_running() - return salt_master.salt_cli(timeout=30) - - -@pytest.fixture(scope="package", autouse=True) -def skip_on_tcp_transport(request): - if request.config.getoption("--transport") == "tcp": - pytest.skip("Deltaproxy under the TPC transport is not working. See #61367") - - -@pytest.fixture -def proxy_minion_id(salt_master): - _proxy_minion_id = random_string("proxy-minion-") - - try: - yield _proxy_minion_id - finally: - # Remove stale key if it exists - pytest.helpers.remove_stale_minion_key(salt_master, _proxy_minion_id) - - -def clear_proxy_minions(salt_master, proxy_minion_id): - for proxy in [proxy_minion_id, "dummy_proxy_one", "dummy_proxy_two"]: - pytest.helpers.remove_stale_minion_key(salt_master, proxy) - - cachefile = os.path.join( - salt_master.config["cachedir"], "{}.cache".format(proxy) - ) - if os.path.exists(cachefile): - os.unlink(cachefile) - - -# Hangs on Windows. You can add a timeout to the proxy.run command, but then -# it just times out. -@pytest.mark.skip_on_windows(reason=PRE_PYTEST_SKIP_REASON) -@pytest.mark.parametrize( - "parallel_startup", - [True, False], - ids=["parallel_startup=True", "parallel_startup=False"], -) -def test_exit_status_correct_usage_large_number_of_minions( - salt_master, - salt_cli, - proxy_minion_id, - parallel_startup, -): - """ - Ensure the salt-proxy control proxy starts and - is able to respond to test.ping, additionally ensure that - the proxies being controlled also respond to test.ping. - - Finally ensure correct exit status when salt-proxy exits correctly. - - Skip on Windows because daemonization not supported - """ - - config_defaults = { - "metaproxy": "deltaproxy", - } - sub_proxies = [ - "proxy_one", - "proxy_two", - "proxy_three", - "proxy_four", - "proxy_five", - "proxy_six", - "proxy_seven", - "proxy_eight", - "proxy_nine", - "proxy_ten", - "proxy_eleven", - "proxy_twelve", - "proxy_thirteen", - "proxy_fourteen", - "proxy_fifteen", - "proxy_sixteen", - "proxy_seventeen", - "proxy_eighteen", - "proxy_nineteen", - "proxy_twenty", - "proxy_twenty_one", - "proxy_twenty_two", - "proxy_twenty_three", - "proxy_twenty_four", - "proxy_twenty_five", - "proxy_twenty_six", - "proxy_twenty_seven", - "proxy_twenty_eight", - "proxy_twenty_nine", - "proxy_thirty", - "proxy_thirty_one", - "proxy_thirty_two", - ] - - top_file = """ - base: - {control}: - - controlproxy - """.format( - control=proxy_minion_id, - ) - controlproxy_pillar_file = """ - proxy: - proxytype: deltaproxy - parallel_startup: {} - ids: - """.format( - parallel_startup - ) - - dummy_proxy_pillar_file = """ - proxy: - proxytype: dummy - """ - - for minion_id in sub_proxies: - top_file += """ - {minion_id}: - - dummy""".format( - minion_id=minion_id, - ) - - controlproxy_pillar_file += """ - - {} - """.format( - minion_id, - ) - - top_tempfile = salt_master.pillar_tree.base.temp_file("top.sls", top_file) - controlproxy_tempfile = salt_master.pillar_tree.base.temp_file( - "controlproxy.sls", controlproxy_pillar_file - ) - dummy_proxy_tempfile = salt_master.pillar_tree.base.temp_file( - "dummy.sls", - dummy_proxy_pillar_file, - ) - with top_tempfile, controlproxy_tempfile, dummy_proxy_tempfile: - with salt_master.started(): - assert salt_master.is_running() - - factory = salt_master.salt_proxy_minion_daemon( - proxy_minion_id, - defaults=config_defaults, - extra_cli_arguments_after_first_start_failure=["--log-level=info"], - start_timeout=240, - ) - - for minion_id in [proxy_minion_id] + sub_proxies: - factory.before_start( - pytest.helpers.remove_stale_proxy_minion_cache_file, - factory, - minion_id, - ) - factory.after_terminate( - pytest.helpers.remove_stale_minion_key, salt_master, minion_id - ) - factory.after_terminate( - pytest.helpers.remove_stale_proxy_minion_cache_file, - factory, - minion_id, - ) - - with factory.started(): - assert factory.is_running() - - # Let's issue a ping the control proxy - ret = salt_cli.run("test.ping", minion_tgt=proxy_minion_id) - assert ret.returncode == 0 - assert ret.data is True - - for minion_id in random.sample(sub_proxies, 4): - # Let's issue a ping to one of the controlled proxies - ret = salt_cli.run("test.ping", minion_tgt=minion_id) - assert ret.returncode == 0 - assert ret.data is True - - # Terminate the proxy minion - ret = factory.terminate() - assert ret.returncode == salt.defaults.exitcodes.EX_OK, ret - - # Terminate the salt master - ret = salt_master.terminate() - assert ret.returncode == salt.defaults.exitcodes.EX_OK, ret diff --git a/tests/pytests/integration/cli/test_salt_deltaproxy.py b/tests/pytests/integration/cli/test_salt_deltaproxy.py index 13ee95fee72..5a6e847b78a 100644 --- a/tests/pytests/integration/cli/test_salt_deltaproxy.py +++ b/tests/pytests/integration/cli/test_salt_deltaproxy.py @@ -1,9 +1,8 @@ """ :codeauthor: Gareth J. Greenaway (ggreenaway@vmware.com) """ - import logging -import os +import random import pytest from pytestshellutils.exceptions import FactoryNotStarted @@ -24,7 +23,7 @@ pytestmark = [ @pytest.fixture(scope="package", autouse=True) -def skip_on_tcp_transport(request): +def _skip_on_tcp_transport(request): if request.config.getoption("--transport") == "tcp": pytest.skip("Deltaproxy under the TPC transport is not working. See #61367") @@ -40,17 +39,6 @@ def proxy_minion_id(salt_master): pytest.helpers.remove_stale_minion_key(salt_master, _proxy_minion_id) -def clear_proxy_minions(salt_master, proxy_minion_id): - for proxy in [proxy_minion_id, "dummy_proxy_one", "dummy_proxy_two"]: - pytest.helpers.remove_stale_minion_key(salt_master, proxy) - - cachefile = os.path.join( - salt_master.config["cachedir"], "{}.cache".format(proxy) - ) - if os.path.exists(cachefile): - os.unlink(cachefile) - - def test_exit_status_no_proxyid(salt_master, proxy_minion_id): """ Ensure correct exit status when --proxyid argument is missing. @@ -718,3 +706,145 @@ def ping(): # Terminate the proxy minion ret = factory.terminate() assert ret.returncode == salt.defaults.exitcodes.EX_OK, ret + + +# Hangs on Windows. You can add a timeout to the proxy.run command, but then +# it just times out. +@pytest.mark.skip_on_windows(reason=PRE_PYTEST_SKIP_REASON) +@pytest.mark.timeout_unless_on_windows(180) +@pytest.mark.parametrize( + "parallel_startup", + [True, False], + ids=["parallel_startup=True", "parallel_startup=False"], +) +def test_exit_status_correct_usage_large_number_of_minions( + salt_master, + salt_cli, + proxy_minion_id, + parallel_startup, +): + """ + Ensure the salt-proxy control proxy starts and + is able to respond to test.ping, additionally ensure that + the proxies being controlled also respond to test.ping. + + Finally ensure correct exit status when salt-proxy exits correctly. + + Skip on Windows because daemonization not supported + """ + + config_defaults = { + "metaproxy": "deltaproxy", + } + sub_proxies = [ + "proxy_one", + "proxy_two", + "proxy_three", + "proxy_four", + "proxy_five", + "proxy_six", + "proxy_seven", + "proxy_eight", + "proxy_nine", + "proxy_ten", + "proxy_eleven", + "proxy_twelve", + "proxy_thirteen", + "proxy_fourteen", + "proxy_fifteen", + "proxy_sixteen", + "proxy_seventeen", + "proxy_eighteen", + "proxy_nineteen", + "proxy_twenty", + "proxy_twenty_one", + "proxy_twenty_two", + "proxy_twenty_three", + "proxy_twenty_four", + "proxy_twenty_five", + "proxy_twenty_six", + "proxy_twenty_seven", + "proxy_twenty_eight", + "proxy_twenty_nine", + "proxy_thirty", + "proxy_thirty_one", + "proxy_thirty_two", + ] + + top_file = """ + base: + {control}: + - controlproxy + """.format( + control=proxy_minion_id, + ) + controlproxy_pillar_file = f""" + proxy: + proxytype: deltaproxy + parallel_startup: {parallel_startup} + ids: + """ + + dummy_proxy_pillar_file = """ + proxy: + proxytype: dummy + """ + + for minion_id in sub_proxies: + top_file += f""" + {minion_id}: + - dummy""" + + controlproxy_pillar_file += f""" + - {minion_id} + """ + + top_tempfile = salt_master.pillar_tree.base.temp_file("top.sls", top_file) + controlproxy_tempfile = salt_master.pillar_tree.base.temp_file( + "controlproxy.sls", controlproxy_pillar_file + ) + dummy_proxy_tempfile = salt_master.pillar_tree.base.temp_file( + "dummy.sls", + dummy_proxy_pillar_file, + ) + with top_tempfile, controlproxy_tempfile, dummy_proxy_tempfile: + + factory = salt_master.salt_proxy_minion_daemon( + proxy_minion_id, + defaults=config_defaults, + extra_cli_arguments_after_first_start_failure=["--log-level=info"], + start_timeout=240, + ) + + for minion_id in [proxy_minion_id] + sub_proxies: + factory.before_start( + pytest.helpers.remove_stale_proxy_minion_cache_file, + factory, + minion_id, + ) + factory.after_terminate( + pytest.helpers.remove_stale_minion_key, salt_master, minion_id + ) + factory.after_terminate( + pytest.helpers.remove_stale_proxy_minion_cache_file, + factory, + minion_id, + ) + + with factory.started(): + assert factory.is_running() + + # Let's issue a ping the control proxy + ret = salt_cli.run("test.ping", minion_tgt=proxy_minion_id) + assert ret.returncode == 0 + assert ret.data is True + + for minion_id in random.sample(sub_proxies, 4): + # Let's issue a ping to one of the controlled proxies + ret = salt_cli.run("test.ping", minion_tgt=minion_id) + assert ret.returncode == 0 + assert ret.data is True + + # Terminate the proxy minion + ret = factory.terminate() + assert ret.returncode == salt.defaults.exitcodes.EX_OK, ret From beb2c6d7b4aded96a64d41c202d303684df77ea3 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 23 Jan 2024 12:57:33 +0000 Subject: [PATCH 24/96] Some more test timeout updates Signed-off-by: Pedro Algarvio --- tests/integration/modules/test_gem.py | 1 + tests/integration/modules/test_localemod.py | 1 + tests/integration/ssh/test_state.py | 1 + .../pytests/functional/channel/test_server.py | 3 +- .../functional/modules/test_mac_brew_pkg.py | 2 +- .../modules/test_mac_softwareupdate.py | 1 + tests/pytests/functional/modules/test_pkg.py | 62 +++++++++++-------- .../functional/states/pkgrepo/test_debian.py | 20 ++---- tests/pytests/functional/test_version.py | 1 + .../integration/minion/test_job_return.py | 5 +- .../integration/minion/test_return_retries.py | 4 +- .../integration/modules/grains/test_append.py | 2 +- .../pytests/integration/modules/test_virt.py | 1 + .../integration/netapi/test_ssh_client.py | 9 ++- .../state/orchestrate/test_orchestrate.py | 1 + .../integration/states/test_ansiblegate.py | 1 + .../integration/states/test_x509_v2.py | 1 + tests/pytests/unit/grains/test_core.py | 1 + 18 files changed, 69 insertions(+), 48 deletions(-) diff --git a/tests/integration/modules/test_gem.py b/tests/integration/modules/test_gem.py index f484e8c3c1d..36ed2edf09a 100644 --- a/tests/integration/modules/test_gem.py +++ b/tests/integration/modules/test_gem.py @@ -18,6 +18,7 @@ def check_status(): return False +@pytest.mark.timeout_unless_on_windows(120) @pytest.mark.skip_if_binaries_missing("gem") @pytest.mark.windows_whitelisted @pytest.mark.destructive_test diff --git a/tests/integration/modules/test_localemod.py b/tests/integration/modules/test_localemod.py index 1fbce18872a..349893e138f 100644 --- a/tests/integration/modules/test_localemod.py +++ b/tests/integration/modules/test_localemod.py @@ -27,6 +27,7 @@ class LocaleModuleTest(ModuleCase): locale = self.run_function("locale.get_locale") self.assertNotIn("Unsupported platform!", locale) + @pytest.mark.timeout(120) @pytest.mark.destructive_test @pytest.mark.slow_test def test_gen_locale(self): diff --git a/tests/integration/ssh/test_state.py b/tests/integration/ssh/test_state.py index a9fd3e7f2d3..48f634f309f 100644 --- a/tests/integration/ssh/test_state.py +++ b/tests/integration/ssh/test_state.py @@ -55,6 +55,7 @@ class SSHStateTest(SSHCase): self.assertTrue(check_file) @pytest.mark.slow_test + @pytest.mark.timeout_unless_on_windows(120) def test_state_sls_id(self): """ test state.sls_id with salt-ssh diff --git a/tests/pytests/functional/channel/test_server.py b/tests/pytests/functional/channel/test_server.py index da6f9caa8c9..6b0241ab23a 100644 --- a/tests/pytests/functional/channel/test_server.py +++ b/tests/pytests/functional/channel/test_server.py @@ -28,7 +28,8 @@ log = logging.getLogger(__name__) pytestmark = [ pytest.mark.skip_on_spawning_platform( reason="These tests are currently broken on spawning platforms. Need to be rewritten.", - ) + ), + pytest.mark.timeout_unless_on_windows(120), ] diff --git a/tests/pytests/functional/modules/test_mac_brew_pkg.py b/tests/pytests/functional/modules/test_mac_brew_pkg.py index 1582e7eea35..e1e23606ee8 100644 --- a/tests/pytests/functional/modules/test_mac_brew_pkg.py +++ b/tests/pytests/functional/modules/test_mac_brew_pkg.py @@ -7,6 +7,7 @@ import pytest pytestmark = [ pytest.mark.slow_test, + pytest.mark.timeout(120), pytest.mark.destructive_test, pytest.mark.skip_if_not_root, pytest.mark.skip_unless_on_darwin, @@ -49,7 +50,6 @@ def pkg_2_name(pkg): pkg.remove(pkg_name) -@pytest.mark.timeout(120) def test_brew_install(pkg, pkg_1_name): """ Tests the installation of packages diff --git a/tests/pytests/functional/modules/test_mac_softwareupdate.py b/tests/pytests/functional/modules/test_mac_softwareupdate.py index 8cc839f0796..eb5f01550ea 100644 --- a/tests/pytests/functional/modules/test_mac_softwareupdate.py +++ b/tests/pytests/functional/modules/test_mac_softwareupdate.py @@ -8,6 +8,7 @@ from salt.exceptions import SaltInvocationError pytestmark = [ pytest.mark.slow_test, + pytest.mark.timeout(240), pytest.mark.skip_if_binaries_missing("softwareupdate"), pytest.mark.skip_if_not_root, pytest.mark.skip_unless_on_darwin, diff --git a/tests/pytests/functional/modules/test_pkg.py b/tests/pytests/functional/modules/test_pkg.py index 8e16fd3fdc4..fa5147141e4 100644 --- a/tests/pytests/functional/modules/test_pkg.py +++ b/tests/pytests/functional/modules/test_pkg.py @@ -3,7 +3,6 @@ import logging import os import re import shutil -import tempfile import time import pytest @@ -15,6 +14,10 @@ import salt.utils.platform log = logging.getLogger(__name__) +pytestmark = [ + pytest.mark.timeout_unless_on_windows(240), +] + @pytest.fixture def ctx(): @@ -22,25 +25,24 @@ def ctx(): @pytest.fixture -def preserve_rhel_yum_conf(): +def _preserve_rhel_yum_conf(tmp_path): # save off current yum.conf cfg_file = "/etc/yum.conf" if not os.path.exists(cfg_file): pytest.skip("Only runs on RedHat.") - tmp_dir = str(tempfile.gettempdir()) - tmp_file = os.path.join(tmp_dir, "yum.conf") + tmp_file = tmp_path / "yum.conf" shutil.copy2(cfg_file, tmp_file) - yield - - # restore saved yum.conf - shutil.copy2(tmp_file, cfg_file) - os.remove(tmp_file) + try: + yield + finally: + # restore saved yum.conf + shutil.copy2(tmp_file, cfg_file) @pytest.fixture -def refresh_db(ctx, grains, modules): +def _refresh_db(ctx, grains, modules): if "refresh" not in ctx: modules.pkg.refresh_db() ctx["refresh"] = True @@ -73,9 +75,10 @@ def test_pkg(grains): return _pkg +@pytest.mark.usefixtures("_refresh_db") @pytest.mark.requires_salt_modules("pkg.list_pkgs") @pytest.mark.slow_test -def test_list(modules, refresh_db): +def test_list(modules): """ verify that packages are installed """ @@ -107,11 +110,12 @@ def test_version_cmp(grains, modules): assert modules.pkg.version_cmp(*gt) == 1 +@pytest.mark.usefixtures("_refresh_db") @pytest.mark.destructive_test @pytest.mark.requires_salt_modules("pkg.mod_repo", "pkg.del_repo", "pkg.get_repo") @pytest.mark.slow_test @pytest.mark.requires_network -def test_mod_del_repo(grains, modules, refresh_db): +def test_mod_del_repo(grains, modules): """ test modifying and deleting a software repository """ @@ -161,7 +165,8 @@ def test_mod_del_repo(grains, modules, refresh_db): @pytest.mark.slow_test -def test_mod_del_repo_multiline_values(modules, refresh_db): +@pytest.mark.usefixtures("_refresh_db") +def test_mod_del_repo_multiline_values(modules): """ test modifying and deleting a software repository defined with multiline values """ @@ -175,7 +180,6 @@ def test_mod_del_repo_multiline_values(modules, refresh_db): expected_get_repo_baseurl = ( "http://my.fake.repo/foo/bar/\nhttp://my.fake.repo.alt/foo/bar/" ) - major_release = int(modules.grains.item("osmajorrelease")["osmajorrelease"]) repo = "fakerepo" name = "Fake repo for RHEL/CentOS/SUSE" baseurl = my_baseurl @@ -224,16 +228,16 @@ def test_which(modules): """ test finding the package owning a file """ - func = "pkg.which" ret = modules.pkg.which("/usr/local/bin/salt-call") assert len(ret) != 0 +@pytest.mark.usefixtures("_refresh_db") @pytest.mark.destructive_test @pytest.mark.requires_salt_modules("pkg.version", "pkg.install", "pkg.remove") @pytest.mark.slow_test @pytest.mark.requires_network -def test_install_remove(modules, test_pkg, refresh_db): +def test_install_remove(modules, test_pkg): """ successfully install and uninstall a package """ @@ -258,6 +262,7 @@ def test_install_remove(modules, test_pkg, refresh_db): test_remove() +@pytest.mark.usefixtures("_refresh_db") @pytest.mark.destructive_test @pytest.mark.skip_on_photonos( reason="package hold/unhold unsupported on Photon OS", @@ -273,7 +278,7 @@ def test_install_remove(modules, test_pkg, refresh_db): @pytest.mark.slow_test @pytest.mark.requires_network @pytest.mark.requires_salt_states("pkg.installed") -def test_hold_unhold(grains, modules, states, test_pkg, refresh_db): +def test_hold_unhold(grains, modules, states, test_pkg): """ test holding and unholding a package """ @@ -315,11 +320,12 @@ def test_hold_unhold(grains, modules, states, test_pkg, refresh_db): assert ret.result is True +@pytest.mark.usefixtures("_refresh_db") @pytest.mark.destructive_test @pytest.mark.requires_salt_modules("pkg.refresh_db") @pytest.mark.slow_test @pytest.mark.requires_network -def test_refresh_db(grains, tmp_path, minion_opts, refresh_db): +def test_refresh_db(grains, minion_opts): """ test refreshing the package database """ @@ -344,9 +350,10 @@ def test_refresh_db(grains, tmp_path, minion_opts, refresh_db): assert os.path.isfile(rtag) is False +@pytest.mark.usefixtures("_refresh_db") @pytest.mark.requires_salt_modules("pkg.info_installed") @pytest.mark.slow_test -def test_pkg_info(grains, modules, test_pkg, refresh_db): +def test_pkg_info(grains, modules, test_pkg): """ Test returning useful information on Ubuntu systems. """ @@ -371,6 +378,7 @@ def test_pkg_info(grains, modules, test_pkg, refresh_db): assert test_pkg in keys +@pytest.mark.usefixtures("_refresh_db") @pytest.mark.skipif(True, reason="Temporary Skip - Causes centos 8 test to fail") @pytest.mark.destructive_test @pytest.mark.requires_salt_modules( @@ -382,7 +390,7 @@ def test_pkg_info(grains, modules, test_pkg, refresh_db): ) @pytest.mark.slow_test @pytest.mark.requires_network -def test_pkg_upgrade_has_pending_upgrades(grains, modules, test_pkg, refresh_db): +def test_pkg_upgrade_has_pending_upgrades(grains, modules): """ Test running a system upgrade when there are packages that need upgrading """ @@ -452,6 +460,7 @@ def test_pkg_upgrade_has_pending_upgrades(grains, modules, test_pkg, refresh_db) assert ret != {} +@pytest.mark.usefixtures("_refresh_db") @pytest.mark.destructive_test @pytest.mark.skip_on_darwin( reason="The jenkins user is equivalent to root on mac, causing the test to be unrunnable" @@ -459,7 +468,7 @@ def test_pkg_upgrade_has_pending_upgrades(grains, modules, test_pkg, refresh_db) @pytest.mark.requires_salt_modules("pkg.remove", "pkg.latest_version") @pytest.mark.slow_test @pytest.mark.requires_salt_states("pkg.removed") -def test_pkg_latest_version(grains, modules, states, test_pkg, refresh_db): +def test_pkg_latest_version(grains, modules, states, test_pkg): """ Check that pkg.latest_version returns the latest version of the uninstalled package. The package is not installed. Only the package version is checked. @@ -497,10 +506,11 @@ def test_pkg_latest_version(grains, modules, states, test_pkg, refresh_db): assert pkg_latest in cmd_pkg +@pytest.mark.usefixtures("_preserve_rhel_yum_conf") @pytest.mark.destructive_test @pytest.mark.requires_salt_modules("pkg.list_repos") @pytest.mark.slow_test -def test_list_repos_duplicate_entries(preserve_rhel_yum_conf, grains, modules): +def test_list_repos_duplicate_entries(grains, modules): """ test duplicate entries in /etc/yum.conf @@ -531,13 +541,13 @@ def test_list_repos_duplicate_entries(preserve_rhel_yum_conf, grains, modules): # test explicitly strict_config expected = "While reading from '/etc/yum.conf' [line 8]: option 'http_caching' in section 'main' already exists" with pytest.raises(configparser.DuplicateOptionError) as exc_info: - result = modules.pkg.list_repos(strict_config=True) - assert "{}".format(exc_info.value) == expected + modules.pkg.list_repos(strict_config=True) + assert str(exc_info.value) == expected # test implicitly strict_config with pytest.raises(configparser.DuplicateOptionError) as exc_info: - result = modules.pkg.list_repos() - assert "{}".format(exc_info.value) == expected + modules.pkg.list_repos() + assert str(exc_info.value) == expected @pytest.mark.destructive_test diff --git a/tests/pytests/functional/states/pkgrepo/test_debian.py b/tests/pytests/functional/states/pkgrepo/test_debian.py index b8c8344c095..5452ecac1c4 100644 --- a/tests/pytests/functional/states/pkgrepo/test_debian.py +++ b/tests/pytests/functional/states/pkgrepo/test_debian.py @@ -6,7 +6,6 @@ import shutil import sys from sysconfig import get_path -import _pytest._version import attr import pytest @@ -15,12 +14,10 @@ import salt.utils.files from tests.conftest import CODE_DIR from tests.support.mock import MagicMock, patch -PYTEST_GE_7 = getattr(_pytest._version, "version_tuple", (-1, -1)) >= (7, 0) - - log = logging.getLogger(__name__) pytestmark = [ + pytest.mark.timeout_unless_on_windows(120), pytest.mark.destructive_test, pytest.mark.skip_if_not_root, pytest.mark.slow_test, @@ -30,11 +27,8 @@ pytestmark = [ @pytest.fixture def pkgrepo(states, grains): if grains["os_family"] != "Debian": - exc_kwargs = {} - if PYTEST_GE_7: - exc_kwargs["_use_item_location"] = True raise pytest.skip.Exception( - "Test only for debian based platforms", **exc_kwargs + "Test only for debian based platforms", _use_item_location=True ) return states.pkgrepo @@ -102,12 +96,9 @@ def system_aptsources_ids(value): def system_aptsources(request, grains): sys_modules = list(sys.modules) copied_paths = [] - exc_kwargs = {} - if PYTEST_GE_7: - exc_kwargs["_use_item_location"] = True if grains["os_family"] != "Debian": raise pytest.skip.Exception( - "Test only for debian based platforms", **exc_kwargs + "Test only for debian based platforms", _use_item_location=True ) try: try: @@ -117,7 +108,7 @@ def system_aptsources(request, grains): raise pytest.skip.Exception( "This test is meant to run without the system aptsources package, but it's " "available from '{}'.".format(sourceslist.__file__), - **exc_kwargs, + _use_item_location=True, ) else: # Run the test @@ -162,7 +153,8 @@ def system_aptsources(request, grains): shutil.copyfile(src, dst) if not copied_paths: raise pytest.skip.Exception( - "aptsources.sourceslist python module not found", **exc_kwargs + "aptsources.sourceslist python module not found", + _use_item_location=True, ) # Run the test yield request.param diff --git a/tests/pytests/functional/test_version.py b/tests/pytests/functional/test_version.py index dfa8850557e..b0e40dc3666 100644 --- a/tests/pytests/functional/test_version.py +++ b/tests/pytests/functional/test_version.py @@ -9,6 +9,7 @@ from tests.support.pytest.helpers import FakeSaltExtension pytestmark = [ # These are slow because they create a virtualenv and install salt in it pytest.mark.slow_test, + pytest.mark.timeout(120), ] log = logging.getLogger(__name__) diff --git a/tests/pytests/integration/minion/test_job_return.py b/tests/pytests/integration/minion/test_job_return.py index 19f25e8baa2..7d421419d07 100644 --- a/tests/pytests/integration/minion/test_job_return.py +++ b/tests/pytests/integration/minion/test_job_return.py @@ -91,9 +91,10 @@ def salt_minion_1(salt_master_1, salt_master_2): yield factory -def test_job_resturn(salt_master_1, salt_master_2, salt_minion_1): +@pytest.mark.timeout_unless_on_windows(360) +def test_job_return(salt_master_1, salt_master_2, salt_minion_1): cli = salt_master_1.salt_cli(timeout=120) - ret = cli.run("test.ping", "-v", minion_tgt="minion-1") + ret = cli.run("test.ping", "-v", minion_tgt=salt_minion_1.id) for line in ret.stdout.splitlines(): if "with jid" in line: jid = line.split("with jid")[1].strip() diff --git a/tests/pytests/integration/minion/test_return_retries.py b/tests/pytests/integration/minion/test_return_retries.py index f70609cdb1a..37ea32ffce8 100644 --- a/tests/pytests/integration/minion/test_return_retries.py +++ b/tests/pytests/integration/minion/test_return_retries.py @@ -44,17 +44,19 @@ def test_publish_retry(salt_master, salt_minion_retry, salt_cli, salt_run_cli): time.sleep(5) data = None - for i in range(1, 30): + for _ in range(1, 30): time.sleep(1) data = salt_run_cli.run("jobs.lookup_jid", jid, _timeout=60).data if data: break + assert data assert salt_minion_retry.id in data assert data[salt_minion_retry.id] is True @pytest.mark.slow_test +@pytest.mark.timeout_unless_on_windows(180) def test_pillar_timeout(salt_master_factory, tmp_path): cmd = 'print(\'{"foo": "bar"}\');\n' diff --git a/tests/pytests/integration/modules/grains/test_append.py b/tests/pytests/integration/modules/grains/test_append.py index 0fb54393f3e..f6d3fa3015b 100644 --- a/tests/pytests/integration/modules/grains/test_append.py +++ b/tests/pytests/integration/modules/grains/test_append.py @@ -106,7 +106,7 @@ def test_grains_append_val_is_list(salt_call_cli, append_grain): assert ret.data == {append_grain.key: [append_grain.value, second_grain]} -@pytest.mark.timeout_unless_on_windows(120) +@pytest.mark.timeout_unless_on_windows(240) def test_grains_remove_add( salt_call_cli, append_grain, wait_for_pillar_refresh_complete ): diff --git a/tests/pytests/integration/modules/test_virt.py b/tests/pytests/integration/modules/test_virt.py index 8a9b1294065..fbb9c3d0a99 100644 --- a/tests/pytests/integration/modules/test_virt.py +++ b/tests/pytests/integration/modules/test_virt.py @@ -15,6 +15,7 @@ log = logging.getLogger(__name__) pytestmark = [ pytest.mark.slow_test, + pytest.mark.timeout_unless_on_windows(120, func_only=True), pytest.mark.skip_if_binaries_missing("docker"), ] diff --git a/tests/pytests/integration/netapi/test_ssh_client.py b/tests/pytests/integration/netapi/test_ssh_client.py index 199658642d6..20eb789b8f3 100644 --- a/tests/pytests/integration/netapi/test_ssh_client.py +++ b/tests/pytests/integration/netapi/test_ssh_client.py @@ -135,16 +135,19 @@ def test_ssh_disabled(client, auth_creds): assert ret is None -@pytest.mark.timeout_unless_on_windows(120) +@pytest.mark.timeout_unless_on_windows(360, func_only=True) def test_shell_inject_ssh_priv( - client, salt_ssh_roster_file, rosters_dir, tmp_path, salt_auto_account + client, salt_ssh_roster_file, rosters_dir, tmp_path, salt_auto_account, grains ): """ Verify CVE-2020-16846 for ssh_priv variable """ + if grains["os"] == "VMware Photon OS" and grains["osmajorrelease"] == 3: + pytest.skip("Skipping problematic test on PhotonOS 3") # ZDI-CAN-11143 path = tmp_path / "test-11143" tgts = ["repo.saltproject.io", "www.zerodayinitiative.com"] + ret = None for tgt in tgts: low = { "roster": "cache", @@ -161,7 +164,9 @@ def test_shell_inject_ssh_priv( ret = client.run(low) if ret: break + assert path.exists() is False + assert ret assert not ret[tgt]["stdout"] assert ret[tgt]["stderr"] diff --git a/tests/pytests/integration/runners/state/orchestrate/test_orchestrate.py b/tests/pytests/integration/runners/state/orchestrate/test_orchestrate.py index e4a5c184f3c..013a01e498c 100644 --- a/tests/pytests/integration/runners/state/orchestrate/test_orchestrate.py +++ b/tests/pytests/integration/runners/state/orchestrate/test_orchestrate.py @@ -489,6 +489,7 @@ def _check_skip(grains): return False +@pytest.mark.timeout_unless_on_windows(120) @pytest.mark.skip_initial_gh_actions_failure(skip=_check_skip) def test_orchestrate_subset( salt_run_cli, diff --git a/tests/pytests/integration/states/test_ansiblegate.py b/tests/pytests/integration/states/test_ansiblegate.py index c66ba9075b4..c71f90f3aa0 100644 --- a/tests/pytests/integration/states/test_ansiblegate.py +++ b/tests/pytests/integration/states/test_ansiblegate.py @@ -65,6 +65,7 @@ def ansible_inventory(ansible_inventory_directory, sshd_server): @pytest.mark.requires_sshd_server +@pytest.mark.timeout_unless_on_windows(120) def test_ansible_playbook(salt_call_cli, ansible_inventory, tmp_path): rundir = tmp_path / "rundir" rundir.mkdir(exist_ok=True, parents=True) diff --git a/tests/pytests/integration/states/test_x509_v2.py b/tests/pytests/integration/states/test_x509_v2.py index b13a2a8922a..51418fb230e 100644 --- a/tests/pytests/integration/states/test_x509_v2.py +++ b/tests/pytests/integration/states/test_x509_v2.py @@ -33,6 +33,7 @@ log = logging.getLogger(__name__) pytestmark = [ pytest.mark.slow_test, + pytest.mark.timeout_unless_on_windows(120), pytest.mark.skipif(HAS_LIBS is False, reason="Needs cryptography library"), ] diff --git a/tests/pytests/unit/grains/test_core.py b/tests/pytests/unit/grains/test_core.py index 8fb93e63fb3..a4d3903af83 100644 --- a/tests/pytests/unit/grains/test_core.py +++ b/tests/pytests/unit/grains/test_core.py @@ -2326,6 +2326,7 @@ def test_fqdns_return(): @pytest.mark.skip_unless_on_linux +@pytest.mark.timeout(60) def test_fqdns_socket_error(caplog): """ test the behavior on non-critical socket errors of the dns grain From adb9397bd635042a2562561245c31f146e4ddd91 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Mon, 5 Feb 2024 18:44:28 -0600 Subject: [PATCH 25/96] Don't needlessly refresh fileserver backends during Pillar rendering This uses the opts key that masterless runs use to limit fileserver backend refreshes to a single refresh. Adding it to the master opts ensures that FSChan instances created on the master do not trigger fileserver backend refreshes. --- changelog/65990.fixed.md | 2 ++ salt/config/__init__.py | 8 +++++ tests/unit/test_fileclient.py | 62 +++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 changelog/65990.fixed.md create mode 100644 tests/unit/test_fileclient.py diff --git a/changelog/65990.fixed.md b/changelog/65990.fixed.md new file mode 100644 index 00000000000..32027d2afc3 --- /dev/null +++ b/changelog/65990.fixed.md @@ -0,0 +1,2 @@ +Fixed an issue where fileclient requests during Pillar rendering cause +fileserver backends to be needlessly refreshed. diff --git a/salt/config/__init__.py b/salt/config/__init__.py index ee18ccb3b52..9136118d79d 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py @@ -3948,6 +3948,14 @@ def apply_master_config(overrides=None, defaults=None): opts = defaults.copy() opts["__role"] = "master" + + # Suppress fileserver update in FSChan, for LocalClient instances generated + # during Pillar compilation. The master daemon already handles FS updates + # in its maintenance thread. Refreshing during Pillar compilation slows + # down Pillar considerably (even to the point of timeout) when there are + # many gitfs remotes. + opts["__fs_update"] = True + _adjust_log_file_override(overrides, defaults["log_file"]) if overrides: opts.update(overrides) diff --git a/tests/unit/test_fileclient.py b/tests/unit/test_fileclient.py new file mode 100644 index 00000000000..c15cbcc7ee8 --- /dev/null +++ b/tests/unit/test_fileclient.py @@ -0,0 +1,62 @@ +""" + :codeauthor: Erik Johnson +""" + +import salt.config +from salt import fileclient +from tests.support.mock import MagicMock, patch +from tests.support.unit import TestCase + + +class FSClientTestCase(TestCase): + def _get_defaults(self, **kwargs): + """ + master/minion config defaults + """ + ret = { + "saltenv": kwargs.pop("saltenv", None), + "id": "test", + "cachedir": "/A", + "sock_dir": "/B", + "root_dir": "/C", + "fileserver_backend": "roots", + "open_mode": False, + "auto_accept": False, + "file_roots": {}, + "pillar_roots": {}, + "file_ignore_glob": [], + "file_ignore_regex": [], + "worker_threads": 5, + "hash_type": "sha256", + "log_file": "foo.log", + "ssl": True, + "file_client": "local", + } + ret.update(kwargs) + return ret + + def test_master_no_fs_update(self): + """ + Test that an FSClient spawned from the master does not cause fileserver + backends to be refreshed on instantiation. The master already has the + maintenance thread for that. + """ + opts = salt.config.apply_master_config(defaults=self._get_defaults()) + fileserver = MagicMock() + + with patch("salt.fileserver.Fileserver", fileserver): + client = fileclient.FSClient(opts) + assert client.channel.fs.update.call_count == 0 + + def test_masterless_no_fs_update(self): + """ + Test that an FSClient spawned from a masterless run refreshes the + fileserver backends. This is necessary to ensure that a masterless run + can access any configured gitfs remotes. + """ + opts = salt.config.apply_minion_config(defaults=self._get_defaults()) + fileserver = MagicMock() + + with patch("salt.fileserver.Fileserver", fileserver): + client = fileclient.FSClient(opts) + assert client.channel.fs.update.call_count == 1 From 5e6d23138b454fb4017503f0a7e2ef1680fa51d5 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Tue, 6 Feb 2024 07:00:45 -0600 Subject: [PATCH 26/96] Rename test --- tests/unit/test_fileclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_fileclient.py b/tests/unit/test_fileclient.py index c15cbcc7ee8..d840d1dde60 100644 --- a/tests/unit/test_fileclient.py +++ b/tests/unit/test_fileclient.py @@ -48,7 +48,7 @@ class FSClientTestCase(TestCase): client = fileclient.FSClient(opts) assert client.channel.fs.update.call_count == 0 - def test_masterless_no_fs_update(self): + def test_masterless_fs_update(self): """ Test that an FSClient spawned from a masterless run refreshes the fileserver backends. This is necessary to ensure that a masterless run From 61f8425d24fb466e0bd10eea9660dfab02f726bb Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Tue, 6 Feb 2024 07:05:28 -0600 Subject: [PATCH 27/96] _get_defaults can be a staticmethod --- tests/unit/test_fileclient.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_fileclient.py b/tests/unit/test_fileclient.py index d840d1dde60..266333da08b 100644 --- a/tests/unit/test_fileclient.py +++ b/tests/unit/test_fileclient.py @@ -9,7 +9,8 @@ from tests.support.unit import TestCase class FSClientTestCase(TestCase): - def _get_defaults(self, **kwargs): + @staticmethod + def _get_defaults(**kwargs): """ master/minion config defaults """ From f25bbaf7445d7440decd082841740c3d42cbaca0 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Tue, 6 Feb 2024 10:48:24 -0600 Subject: [PATCH 28/96] Move tests to pytests dir and reformat them --- tests/pytests/unit/test_fileclient.py | 65 +++++++++++++++++++++++++++ tests/unit/test_fileclient.py | 63 -------------------------- 2 files changed, 65 insertions(+), 63 deletions(-) create mode 100644 tests/pytests/unit/test_fileclient.py delete mode 100644 tests/unit/test_fileclient.py diff --git a/tests/pytests/unit/test_fileclient.py b/tests/pytests/unit/test_fileclient.py new file mode 100644 index 00000000000..d9590909e25 --- /dev/null +++ b/tests/pytests/unit/test_fileclient.py @@ -0,0 +1,65 @@ +""" +tests.pytests.unit.test_config +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Unit tests for salt.fileclient +""" + +import salt.config +from salt import fileclient +from tests.support.mock import MagicMock, patch + + +def _defaults(**kwargs): + """ + master/minion config defaults + """ + ret = { + "saltenv": kwargs.pop("saltenv", None), + "id": "test", + "cachedir": "/A", + "sock_dir": "/B", + "root_dir": "/C", + "fileserver_backend": "roots", + "open_mode": False, + "auto_accept": False, + "file_roots": {}, + "pillar_roots": {}, + "file_ignore_glob": [], + "file_ignore_regex": [], + "worker_threads": 5, + "hash_type": "sha256", + "log_file": "foo.log", + "ssl": True, + "file_client": "local", + } + ret.update(kwargs) + return ret + + +def test_master_no_fs_update(): + """ + Test that an FSClient spawned from the master does not cause fileserver + backends to be refreshed on instantiation. The master already has the + maintenance thread for that. + """ + opts = salt.config.apply_master_config(defaults=_defaults()) + fileserver = MagicMock() + + with patch("salt.fileserver.Fileserver", fileserver): + client = fileclient.FSClient(opts) + assert client.channel.fs.update.call_count == 0 + + +def test_masterless_fs_update(): + """ + Test that an FSClient spawned from a masterless run refreshes the + fileserver backends. This is necessary to ensure that a masterless run + can access any configured gitfs remotes. + """ + opts = salt.config.apply_minion_config(defaults=_defaults()) + fileserver = MagicMock() + + with patch("salt.fileserver.Fileserver", fileserver): + client = fileclient.FSClient(opts) + assert client.channel.fs.update.call_count == 1 diff --git a/tests/unit/test_fileclient.py b/tests/unit/test_fileclient.py deleted file mode 100644 index 266333da08b..00000000000 --- a/tests/unit/test_fileclient.py +++ /dev/null @@ -1,63 +0,0 @@ -""" - :codeauthor: Erik Johnson -""" - -import salt.config -from salt import fileclient -from tests.support.mock import MagicMock, patch -from tests.support.unit import TestCase - - -class FSClientTestCase(TestCase): - @staticmethod - def _get_defaults(**kwargs): - """ - master/minion config defaults - """ - ret = { - "saltenv": kwargs.pop("saltenv", None), - "id": "test", - "cachedir": "/A", - "sock_dir": "/B", - "root_dir": "/C", - "fileserver_backend": "roots", - "open_mode": False, - "auto_accept": False, - "file_roots": {}, - "pillar_roots": {}, - "file_ignore_glob": [], - "file_ignore_regex": [], - "worker_threads": 5, - "hash_type": "sha256", - "log_file": "foo.log", - "ssl": True, - "file_client": "local", - } - ret.update(kwargs) - return ret - - def test_master_no_fs_update(self): - """ - Test that an FSClient spawned from the master does not cause fileserver - backends to be refreshed on instantiation. The master already has the - maintenance thread for that. - """ - opts = salt.config.apply_master_config(defaults=self._get_defaults()) - fileserver = MagicMock() - - with patch("salt.fileserver.Fileserver", fileserver): - client = fileclient.FSClient(opts) - assert client.channel.fs.update.call_count == 0 - - def test_masterless_fs_update(self): - """ - Test that an FSClient spawned from a masterless run refreshes the - fileserver backends. This is necessary to ensure that a masterless run - can access any configured gitfs remotes. - """ - opts = salt.config.apply_minion_config(defaults=self._get_defaults()) - fileserver = MagicMock() - - with patch("salt.fileserver.Fileserver", fileserver): - client = fileclient.FSClient(opts) - assert client.channel.fs.update.call_count == 1 From 063adf049355459d41e8f17ee2e74a8ce1d3e749 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 7 Feb 2024 13:20:05 +0000 Subject: [PATCH 29/96] Switch to existing test fixtures --- tests/pytests/unit/test_fileclient.py | 48 ++++----------------------- 1 file changed, 7 insertions(+), 41 deletions(-) diff --git a/tests/pytests/unit/test_fileclient.py b/tests/pytests/unit/test_fileclient.py index d9590909e25..d124f4a94ba 100644 --- a/tests/pytests/unit/test_fileclient.py +++ b/tests/pytests/unit/test_fileclient.py @@ -1,65 +1,31 @@ """ -tests.pytests.unit.test_config -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Unit tests for salt.fileclient """ - -import salt.config -from salt import fileclient +import salt.fileclient as fileclient from tests.support.mock import MagicMock, patch -def _defaults(**kwargs): - """ - master/minion config defaults - """ - ret = { - "saltenv": kwargs.pop("saltenv", None), - "id": "test", - "cachedir": "/A", - "sock_dir": "/B", - "root_dir": "/C", - "fileserver_backend": "roots", - "open_mode": False, - "auto_accept": False, - "file_roots": {}, - "pillar_roots": {}, - "file_ignore_glob": [], - "file_ignore_regex": [], - "worker_threads": 5, - "hash_type": "sha256", - "log_file": "foo.log", - "ssl": True, - "file_client": "local", - } - ret.update(kwargs) - return ret - - -def test_master_no_fs_update(): +def test_master_no_fs_update(master_opts): """ Test that an FSClient spawned from the master does not cause fileserver backends to be refreshed on instantiation. The master already has the maintenance thread for that. """ - opts = salt.config.apply_master_config(defaults=_defaults()) + master_opts["file_client"] = "local" fileserver = MagicMock() - with patch("salt.fileserver.Fileserver", fileserver): - client = fileclient.FSClient(opts) + client = fileclient.FSClient(master_opts) assert client.channel.fs.update.call_count == 0 -def test_masterless_fs_update(): +def test_masterless_fs_update(minion_opts): """ Test that an FSClient spawned from a masterless run refreshes the fileserver backends. This is necessary to ensure that a masterless run can access any configured gitfs remotes. """ - opts = salt.config.apply_minion_config(defaults=_defaults()) + minion_opts["file_client"] = "local" fileserver = MagicMock() - with patch("salt.fileserver.Fileserver", fileserver): - client = fileclient.FSClient(opts) + client = fileclient.FSClient(minion_opts) assert client.channel.fs.update.call_count == 1 From b223b135f9ea7b4f30d871c648c586a4b37898a7 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Wed, 7 Feb 2024 07:29:20 -0600 Subject: [PATCH 30/96] Rename test functions to specify that they are testing FSClient The original draft of these tests was class-based, with the class name describing that the tests were for FSClient. With the class removed, this should be in the test name. --- tests/pytests/unit/test_fileclient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pytests/unit/test_fileclient.py b/tests/pytests/unit/test_fileclient.py index d124f4a94ba..cf9a3e72046 100644 --- a/tests/pytests/unit/test_fileclient.py +++ b/tests/pytests/unit/test_fileclient.py @@ -5,7 +5,7 @@ import salt.fileclient as fileclient from tests.support.mock import MagicMock, patch -def test_master_no_fs_update(master_opts): +def test_fsclient_master_no_fs_update(master_opts): """ Test that an FSClient spawned from the master does not cause fileserver backends to be refreshed on instantiation. The master already has the @@ -18,7 +18,7 @@ def test_master_no_fs_update(master_opts): assert client.channel.fs.update.call_count == 0 -def test_masterless_fs_update(minion_opts): +def test_fsclient_masterless_fs_update(minion_opts): """ Test that an FSClient spawned from a masterless run refreshes the fileserver backends. This is necessary to ensure that a masterless run From 85130a3d3204f0634c1131b0d568bedeae527047 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Wed, 7 Feb 2024 07:49:21 -0600 Subject: [PATCH 31/96] Fix tests --- tests/pytests/unit/test_fileclient.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/pytests/unit/test_fileclient.py b/tests/pytests/unit/test_fileclient.py index cf9a3e72046..c02eae6c1f5 100644 --- a/tests/pytests/unit/test_fileclient.py +++ b/tests/pytests/unit/test_fileclient.py @@ -1,6 +1,7 @@ """ Unit tests for salt.fileclient """ +import salt.config import salt.fileclient as fileclient from tests.support.mock import MagicMock, patch @@ -12,9 +13,10 @@ def test_fsclient_master_no_fs_update(master_opts): maintenance thread for that. """ master_opts["file_client"] = "local" + opts = salt.config.apply_master_config(master_opts) fileserver = MagicMock() with patch("salt.fileserver.Fileserver", fileserver): - client = fileclient.FSClient(master_opts) + client = fileclient.FSClient(opts) assert client.channel.fs.update.call_count == 0 @@ -25,7 +27,8 @@ def test_fsclient_masterless_fs_update(minion_opts): can access any configured gitfs remotes. """ minion_opts["file_client"] = "local" + opts = salt.config.apply_minion_config(minion_opts) fileserver = MagicMock() with patch("salt.fileserver.Fileserver", fileserver): - client = fileclient.FSClient(minion_opts) + client = fileclient.FSClient(opts) assert client.channel.fs.update.call_count == 1 From c3cb87adba5a22a4c7a15253d1e18ee54277ffd8 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Wed, 7 Feb 2024 07:59:32 -0600 Subject: [PATCH 32/96] Don't monkeypatch the fixture contents --- tests/pytests/unit/test_fileclient.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/pytests/unit/test_fileclient.py b/tests/pytests/unit/test_fileclient.py index c02eae6c1f5..d11f5ac2521 100644 --- a/tests/pytests/unit/test_fileclient.py +++ b/tests/pytests/unit/test_fileclient.py @@ -12,8 +12,8 @@ def test_fsclient_master_no_fs_update(master_opts): backends to be refreshed on instantiation. The master already has the maintenance thread for that. """ - master_opts["file_client"] = "local" - opts = salt.config.apply_master_config(master_opts) + overrides = {"file_client": "local"} + opts = salt.config.apply_master_config(overrides, master_opts) fileserver = MagicMock() with patch("salt.fileserver.Fileserver", fileserver): client = fileclient.FSClient(opts) @@ -26,8 +26,8 @@ def test_fsclient_masterless_fs_update(minion_opts): fileserver backends. This is necessary to ensure that a masterless run can access any configured gitfs remotes. """ - minion_opts["file_client"] = "local" - opts = salt.config.apply_minion_config(minion_opts) + overrides = {"file_client": "local"} + opts = salt.config.apply_minion_config(overrides, minion_opts) fileserver = MagicMock() with patch("salt.fileserver.Fileserver", fileserver): client = fileclient.FSClient(opts) From aee4cbc53c1eabbc5d22e1ed9193f2d64f472aa0 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Thu, 8 Feb 2024 07:47:26 -0600 Subject: [PATCH 33/96] Change LocalClient -> FSClient The LocalClient name has been deprecated for some time and now exists only as an alias. --- salt/config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/config/__init__.py b/salt/config/__init__.py index 9136118d79d..688cc5ea455 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py @@ -3949,7 +3949,7 @@ def apply_master_config(overrides=None, defaults=None): opts = defaults.copy() opts["__role"] = "master" - # Suppress fileserver update in FSChan, for LocalClient instances generated + # Suppress fileserver update in FSChan, for FSClient instances generated # during Pillar compilation. The master daemon already handles FS updates # in its maintenance thread. Refreshing during Pillar compilation slows # down Pillar considerably (even to the point of timeout) when there are From 2b028dc565d886cbaf260541a5615a6c0b44d6cb Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Thu, 8 Feb 2024 08:51:18 -0700 Subject: [PATCH 34/96] Fix issue with stacktrace on CTRL+C --- salt/transport/zeromq.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/salt/transport/zeromq.py b/salt/transport/zeromq.py index 703b6ab2cf5..5b006b88592 100644 --- a/salt/transport/zeromq.py +++ b/salt/transport/zeromq.py @@ -703,7 +703,7 @@ class PublishServer(salt.transport.base.DaemonizedPublishServer): ): """ This method represents the Publish Daemon process. It is intended to be - run in a thread or process as it creates and runs an it's own ioloop. + run in a thread or process as it creates and runs its own ioloop. """ ioloop = salt.ext.tornado.ioloop.IOLoop() ioloop.make_current() @@ -750,6 +750,8 @@ class PublishServer(salt.transport.base.DaemonizedPublishServer): pull_sock.on_recv(on_recv) try: ioloop.start() + except KeyboardInterrupt: + pass finally: pub_sock.close() pull_sock.close() From 008a207219aea143703d7e2c0ed1a3aadd49b070 Mon Sep 17 00:00:00 2001 From: Skyler Hawthorne Date: Fri, 24 Nov 2023 14:54:23 -0500 Subject: [PATCH 35/96] log info line when file in s3 changes --- salt/fileserver/s3fs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/salt/fileserver/s3fs.py b/salt/fileserver/s3fs.py index e4ad5e5c6b5..2b9ed90aa7e 100644 --- a/salt/fileserver/s3fs.py +++ b/salt/fileserver/s3fs.py @@ -721,6 +721,8 @@ def _get_file_from_s3(metadata, saltenv, bucket_name, path, cached_file_path): # hashes match we have a cache hit if cached_md5 == file_md5: return + else: + log.info(f"found different hash for file {path}, updating...") else: cached_file_stat = os.stat(cached_file_path) cached_file_size = cached_file_stat.st_size From f25cef6a6cd02ae7ca9f479ed55e38ddd5683d12 Mon Sep 17 00:00:00 2001 From: Skyler Hawthorne Date: Tue, 5 Dec 2023 10:14:27 -0500 Subject: [PATCH 36/96] s3fs: downgrade s3fs log listing individual files to debug --- salt/fileserver/s3fs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/fileserver/s3fs.py b/salt/fileserver/s3fs.py index 2b9ed90aa7e..aa03c33bbcd 100644 --- a/salt/fileserver/s3fs.py +++ b/salt/fileserver/s3fs.py @@ -134,7 +134,7 @@ def update(): cached_file_path = _get_cached_file_name( bucket, saltenv, file_path ) - log.info("%s - %s : %s", bucket, saltenv, file_path) + log.debug("%s - %s : %s", bucket, saltenv, file_path) # load the file from S3 if it's not in the cache or it's old _get_file_from_s3( From 3703fc5291909fdbaf2eed232bc2e5fd17a71578 Mon Sep 17 00:00:00 2001 From: Skyler Hawthorne Date: Mon, 20 Nov 2023 19:00:50 -0500 Subject: [PATCH 37/96] fix incorrect hash type result in s3fs The s3fs backend is currently computing the incorrect hash type. The default hashing algorithm was changed from md5 to sha256. The s3 backend calls the hashing function without specifying the hash algorithm, and then hardcodes the result's hash type to md5. After the change to sha256, this means it was computing a sha256 sum, but saying it was md5. In turn, it would compute the sha256 sum of the existing target file and compare it to the cached file's md5, which would obviously always be different. This causes downstream effects, such as test mode always reporting a change, even when there isn't one. Fixes #65589 --- changelog/65589.fixed.md | 1 + salt/fileserver/s3fs.py | 12 ++- tests/pytests/unit/fileserver/test_s3fs.py | 116 ++++++++++++++++++++- 3 files changed, 121 insertions(+), 8 deletions(-) create mode 100644 changelog/65589.fixed.md diff --git a/changelog/65589.fixed.md b/changelog/65589.fixed.md new file mode 100644 index 00000000000..e6f8f40e341 --- /dev/null +++ b/changelog/65589.fixed.md @@ -0,0 +1 @@ +Fixes the s3fs backend computing the local cache's files with the wrong hash type diff --git a/salt/fileserver/s3fs.py b/salt/fileserver/s3fs.py index aa03c33bbcd..d013ea3b193 100644 --- a/salt/fileserver/s3fs.py +++ b/salt/fileserver/s3fs.py @@ -104,6 +104,8 @@ import salt.utils.versions log = logging.getLogger(__name__) +S3_HASH_TYPE = "md5" + def envs(): """ @@ -189,7 +191,7 @@ def find_file(path, saltenv="base", **kwargs): def file_hash(load, fnd): """ - Return an MD5 file hash + Return the hash of an object's cached copy """ if "env" in load: # "env" is not supported; Use "saltenv". @@ -208,8 +210,8 @@ def file_hash(load, fnd): ) if os.path.isfile(cached_file_path): - ret["hsum"] = salt.utils.hashutils.get_hash(cached_file_path) - ret["hash_type"] = "md5" + ret["hash_type"] = S3_HASH_TYPE + ret["hsum"] = salt.utils.hashutils.get_hash(cached_file_path, S3_HASH_TYPE) return ret @@ -716,7 +718,9 @@ def _get_file_from_s3(metadata, saltenv, bucket_name, path, cached_file_path): if file_etag.find("-") == -1: file_md5 = file_etag - cached_md5 = salt.utils.hashutils.get_hash(cached_file_path, "md5") + cached_md5 = salt.utils.hashutils.get_hash( + cached_file_path, S3_HASH_TYPE + ) # hashes match we have a cache hit if cached_md5 == file_md5: diff --git a/tests/pytests/unit/fileserver/test_s3fs.py b/tests/pytests/unit/fileserver/test_s3fs.py index b50424a1d1a..7a89543e27f 100644 --- a/tests/pytests/unit/fileserver/test_s3fs.py +++ b/tests/pytests/unit/fileserver/test_s3fs.py @@ -1,19 +1,127 @@ +import os + +import boto3 import pytest +import yaml + +# moto must be imported before boto3 +from moto import mock_s3 import salt.fileserver.s3fs as s3fs +import salt.utils.s3 @pytest.fixture -def configure_loader_modules(tmp_path): +def bucket(): + with mock_s3(): + yield "mybucket" + + +@pytest.fixture(scope="module") +def aws_creds(): + return { + "aws_access_key_id": "testing", + "aws_secret_access_key": "testing", + "aws_session_token": "testing", + "region_name": "us-east-1", + } + + +@pytest.fixture(scope="function") +def configure_loader_modules(tmp_path, bucket): opts = { "cachedir": tmp_path, + "s3.buckets": {"base": [bucket]}, + "s3.location": "us-east-1", + "s3.s3_cache_expire": -1, } - return {s3fs: {"__opts__": opts}} + utils = {"s3.query": salt.utils.s3.query} + + yield {s3fs: {"__opts__": opts, "__utils__": utils}} -def test_cache_round_trip(): +@pytest.fixture(scope="function") +def s3(bucket, aws_creds): + conn = boto3.client("s3", **aws_creds) + conn.create_bucket(Bucket=bucket) + return conn + + +def make_keys(bucket, conn, keys): + for key, data in keys.items(): + conn.put_object( + Bucket=bucket, + Key=key, + Body=data["content"], + ) + + +def verify_cache(bucket, expected): + for key, data in expected.items(): + correct_content = data["content"] + cache_file = s3fs._get_cached_file_name(bucket, "base", key) + assert os.path.exists(cache_file) + + if correct_content is None: + continue + + with salt.utils.files.fopen(cache_file) as f: + content = f.read() + assert correct_content == content + + +def test_update(bucket, s3): + """Tests that files get downloaded from s3 to the local cache.""" + + keys = { + "top.sls": {"content": yaml.dump({"base": {"*": ["foo"]}})}, + "foo.sls": {"content": yaml.dump({"nginx": {"pkg.installed": []}})}, + "files/nginx.conf": {"content": "server {}"}, + } + + make_keys(bucket, s3, keys) + s3fs.update() + verify_cache(bucket, keys) + + # make a modification and update again - verify the change is retrieved + keys["top.sls"]["content"] = yaml.dump({"base": {"*": ["foo", "bar"]}}) + make_keys(bucket, s3, keys) + s3fs.update() + verify_cache(bucket, keys) + + +def test_s3_hash(bucket, s3): + """Verifies that s3fs hashes files correctly.""" + + keys = { + "top.sls": {"content": yaml.dump({"base": {"*": ["foo"]}})}, + "foo.sls": {"content": yaml.dump({"nginx": {"pkg.installed": []}})}, + "files/nginx.conf": {"content": "server {}"}, + } + + make_keys(bucket, s3, keys) + s3fs.update() + + for key, item in keys.items(): + cached_file_path = s3fs._get_cached_file_name(bucket, "base", key) + item["hash"] = salt.utils.hashutils.get_hash( + cached_file_path, s3fs.S3_HASH_TYPE + ) + item["cached_file_path"] = cached_file_path + + load = {"saltenv": "base"} + fnd = {"bucket": bucket} + + for key, item in keys.items(): + fnd["path"] = item["cached_file_path"] + actual_hash = s3fs.file_hash(load, fnd) + assert s3fs.S3_HASH_TYPE == actual_hash["hash_type"] + assert item["hash"] == actual_hash["hsum"] + + +def test_cache_round_trip(bucket): metadata = {"foo": "bar"} - cache_file = s3fs._get_cached_file_name("base", "fake_bucket", "some_file") + cache_file = s3fs._get_cached_file_name(bucket, "base", "somefile") s3fs._write_buckets_cache_file(metadata, cache_file) assert s3fs._read_buckets_cache_file(cache_file) == metadata From 37587fbd8af07b5ca0f56d1f4b833357672607b8 Mon Sep 17 00:00:00 2001 From: Skyler Hawthorne Date: Thu, 8 Feb 2024 21:31:54 -0500 Subject: [PATCH 38/96] skip tests on fips tests fail on fips enabled platforms due to md5 being disallowed by default --- tests/pytests/unit/fileserver/test_s3fs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/pytests/unit/fileserver/test_s3fs.py b/tests/pytests/unit/fileserver/test_s3fs.py index 7a89543e27f..2c14738a68c 100644 --- a/tests/pytests/unit/fileserver/test_s3fs.py +++ b/tests/pytests/unit/fileserver/test_s3fs.py @@ -70,6 +70,7 @@ def verify_cache(bucket, expected): assert correct_content == content +@pytest.mark.skip_on_fips_enabled_platform def test_update(bucket, s3): """Tests that files get downloaded from s3 to the local cache.""" @@ -90,6 +91,7 @@ def test_update(bucket, s3): verify_cache(bucket, keys) +@pytest.mark.skip_on_fips_enabled_platform def test_s3_hash(bucket, s3): """Verifies that s3fs hashes files correctly.""" @@ -119,6 +121,7 @@ def test_s3_hash(bucket, s3): assert item["hash"] == actual_hash["hsum"] +@pytest.mark.skip_on_fips_enabled_platform def test_cache_round_trip(bucket): metadata = {"foo": "bar"} cache_file = s3fs._get_cached_file_name(bucket, "base", "somefile") From 5150b7f726775529406873450724e6e7467719ee Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 13 Feb 2024 22:39:00 -0700 Subject: [PATCH 39/96] Fix line endings in auth_v1 test key --- tests/pytests/functional/test_crypt.py | 12 ++++++++++++ tests/pytests/unit/transport/test_zeromq.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/pytests/functional/test_crypt.py diff --git a/tests/pytests/functional/test_crypt.py b/tests/pytests/functional/test_crypt.py new file mode 100644 index 00000000000..0c8e90e82d6 --- /dev/null +++ b/tests/pytests/functional/test_crypt.py @@ -0,0 +1,12 @@ +import pathlib + +import pytest + +import salt.crypt + + +@pytest.mark.windows_whitelisted +def test_generated_keys(tmp_path): + priv = salt.crypt.gen_keys(tmp_path, "aaa", 2048) + assert "\r" not in pathlib.Path(priv).read_text() + assert "\r" not in pathlib.Path(priv.replace(".pem", ".pub")).read_text() diff --git a/tests/pytests/unit/transport/test_zeromq.py b/tests/pytests/unit/transport/test_zeromq.py index fe8c3943827..c5d5242319f 100644 --- a/tests/pytests/unit/transport/test_zeromq.py +++ b/tests/pytests/unit/transport/test_zeromq.py @@ -1044,7 +1044,7 @@ async def test_req_serv_auth_v1(pki_dir): with salt.utils.files.fopen( str(pki_dir.joinpath("minion", "minion.pub")), "r" ) as fp: - pub_key = fp.read() + pub_key = salt.crypt.clean_key(fp.read()) load = { "cmd": "_auth", From 0878b597973125844a4dbd7052ac234b14334a60 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 13 Feb 2024 19:01:13 +0000 Subject: [PATCH 40/96] Increase timeouts on problematic tests --- tests/integration/cli/test_custom_module.py | 1 + tests/pytests/functional/modules/state/test_jinja_filters.py | 1 + tests/pytests/integration/modules/test_beacons.py | 1 + tests/pytests/integration/modules/test_pillar.py | 1 + tests/pytests/integration/modules/test_x509_v2.py | 1 + .../integration/runners/state/orchestrate/test_events.py | 1 + tests/pytests/integration/runners/test_vault.py | 1 + tests/pytests/integration/states/test_ansiblegate.py | 2 +- tests/pytests/integration/states/test_beacon.py | 1 + 9 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/integration/cli/test_custom_module.py b/tests/integration/cli/test_custom_module.py index 6c048e30cd2..2d0ea870167 100644 --- a/tests/integration/cli/test_custom_module.py +++ b/tests/integration/cli/test_custom_module.py @@ -50,6 +50,7 @@ class SSHCustomModuleTest(SSHCase): self.assertEqual(expected, cmd) @pytest.mark.slow_test + @pytest.mark.timeout(120) def test_ssh_custom_module(self): """ Test custom module work using SSHCase environment diff --git a/tests/pytests/functional/modules/state/test_jinja_filters.py b/tests/pytests/functional/modules/state/test_jinja_filters.py index 38135ac967b..0fd44dba74c 100644 --- a/tests/pytests/functional/modules/state/test_jinja_filters.py +++ b/tests/pytests/functional/modules/state/test_jinja_filters.py @@ -1229,6 +1229,7 @@ def filter(request): return _filter +@pytest.mark.timeout_unless_on_windows(120) def test_filter(state, state_tree, filter, grains): filter.check_skip(grains) with filter(state_tree): diff --git a/tests/pytests/integration/modules/test_beacons.py b/tests/pytests/integration/modules/test_beacons.py index 131ebe5eb47..1a1ae274854 100644 --- a/tests/pytests/integration/modules/test_beacons.py +++ b/tests/pytests/integration/modules/test_beacons.py @@ -12,6 +12,7 @@ from tests.support.helpers import PRE_PYTEST_SKIP_OR_NOT pytestmark = [ pytest.mark.core_test, pytest.mark.windows_whitelisted, + pytest.mark.timeout_unless_on_windows(200), ] diff --git a/tests/pytests/integration/modules/test_pillar.py b/tests/pytests/integration/modules/test_pillar.py index 66f7b9e47bb..43e6a213d71 100644 --- a/tests/pytests/integration/modules/test_pillar.py +++ b/tests/pytests/integration/modules/test_pillar.py @@ -395,6 +395,7 @@ def test_pillar_refresh_pillar_ping(salt_cli, salt_minion, key_pillar): @pytest.mark.slow_test +@pytest.mark.timeout_unless_on_windows(120) def test_pillar_refresh_pillar_scheduler(salt_master, salt_cli, salt_minion): """ Ensure schedule jobs in pillar are only updated when values change. diff --git a/tests/pytests/integration/modules/test_x509_v2.py b/tests/pytests/integration/modules/test_x509_v2.py index 99d0d213397..398e4350c41 100644 --- a/tests/pytests/integration/modules/test_x509_v2.py +++ b/tests/pytests/integration/modules/test_x509_v2.py @@ -452,6 +452,7 @@ def x509_salt_call_cli(x509_salt_minion): return x509_salt_minion.salt_call_cli() +@pytest.mark.timeout_unless_on_windows(120) def test_sign_remote_certificate(x509_salt_call_cli, cert_args, ca_key, rsa_privkey): ret = x509_salt_call_cli.run("x509.create_certificate", **cert_args) assert ret.data diff --git a/tests/pytests/integration/runners/state/orchestrate/test_events.py b/tests/pytests/integration/runners/state/orchestrate/test_events.py index 5ebaf500765..f1deeb5c6f5 100644 --- a/tests/pytests/integration/runners/state/orchestrate/test_events.py +++ b/tests/pytests/integration/runners/state/orchestrate/test_events.py @@ -419,6 +419,7 @@ def test_orchestration_onchanges_and_prereq( @pytest.mark.skip_if_not_root @pytest.mark.skip_on_windows @pytest.mark.skip_on_darwin +@pytest.mark.timeout_unless_on_windows(120) def test_unknown_in_runner_event( runner_salt_run_cli, runner_salt_master, diff --git a/tests/pytests/integration/runners/test_vault.py b/tests/pytests/integration/runners/test_vault.py index 5f662d55170..e1d932abeb0 100644 --- a/tests/pytests/integration/runners/test_vault.py +++ b/tests/pytests/integration/runners/test_vault.py @@ -12,6 +12,7 @@ log = logging.getLogger(__name__) pytestmark = [ pytest.mark.slow_test, + pytest.mark.timeout_unless_on_windows(120), ] diff --git a/tests/pytests/integration/states/test_ansiblegate.py b/tests/pytests/integration/states/test_ansiblegate.py index c71f90f3aa0..0b70a7ab138 100644 --- a/tests/pytests/integration/states/test_ansiblegate.py +++ b/tests/pytests/integration/states/test_ansiblegate.py @@ -65,7 +65,7 @@ def ansible_inventory(ansible_inventory_directory, sshd_server): @pytest.mark.requires_sshd_server -@pytest.mark.timeout_unless_on_windows(120) +@pytest.mark.timeout_unless_on_windows(240) def test_ansible_playbook(salt_call_cli, ansible_inventory, tmp_path): rundir = tmp_path / "rundir" rundir.mkdir(exist_ok=True, parents=True) diff --git a/tests/pytests/integration/states/test_beacon.py b/tests/pytests/integration/states/test_beacon.py index 586664cb560..d84d962f18f 100644 --- a/tests/pytests/integration/states/test_beacon.py +++ b/tests/pytests/integration/states/test_beacon.py @@ -9,6 +9,7 @@ log = logging.getLogger(__name__) @pytest.mark.slow_test +@pytest.mark.timeout_unless_on_windows(120) def test_present_absent(salt_master, salt_minion, salt_call_cli): ret = salt_call_cli.run("beacons.reset") From f77d7ea7502232dffb8214d893a0a08ad546d480 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Mon, 12 Feb 2024 20:44:37 -0600 Subject: [PATCH 41/96] Updates to contributing docs 1. Docs reference an EOL version of Python when recommending a version to install using pyenv. (resolves #65978) 2. Fixes incorrect location for tests (as described in #66021) --- CONTRIBUTING.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index ee4ab88e193..6a41d924ae3 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -88,7 +88,7 @@ version of Python: :: - pyenv install 3.7.0 + pyenv install 3.9.18 If that fails, don't panic! You're probably just missing some build dependencies. Check out `pyenv common build @@ -99,7 +99,7 @@ new virtual environment with this command: :: - pyenv virtualenv 3.7.0 salt + pyenv virtualenv 3.9.18 salt Then activate it: @@ -321,8 +321,8 @@ documentation: :: - pyenv install 3.7.15 - pyenv virtualenv 3.7.15 salt-docs + pyenv install 3.9.18 + pyenv virtualenv 3.9.18 salt-docs echo 'salt-docs' > .python-version #. Activate `pyenv` if it's not auto-activated: @@ -477,7 +477,7 @@ meaningful and complete! *Typically* the best tests for Salt are going to be unit tests. Testing is `a whole topic on its own `__, But you may also want to write functional or integration tests. You'll -find those in the ``salt/tests`` directory. +find those in the ``tests/`` directory. When you're thinking about tests to write, the most important thing to keep in mind is, “What, exactly, am I testing?” When a test fails, you From 5fdb598bc4d4115f86584d5fb7c0389d7639276f Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 14 Feb 2024 08:57:57 +0000 Subject: [PATCH 42/96] Run `pyupgrade` against the files modified in the merge-forward --- tests/integration/cli/test_custom_module.py | 2 +- tests/integration/ssh/test_state.py | 2 +- tests/pytests/functional/states/test_npm.py | 2 +- tests/pytests/integration/states/test_ansiblegate.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/cli/test_custom_module.py b/tests/integration/cli/test_custom_module.py index 2d0ea870167..ec8415424e7 100644 --- a/tests/integration/cli/test_custom_module.py +++ b/tests/integration/cli/test_custom_module.py @@ -71,7 +71,7 @@ class SSHCustomModuleTest(SSHCase): cmd = self.run_function("state.sls", arg=["custom_module"]) for key in cmd: if not isinstance(cmd, dict) or not isinstance(cmd[key], dict): - raise AssertionError("{} is not a proper state return".format(cmd)) + raise AssertionError(f"{cmd} is not a proper state return") elif not cmd[key]["result"]: raise AssertionError(cmd[key]["comment"]) cmd_ret = cmd[key]["changes"].get("ret", None) diff --git a/tests/integration/ssh/test_state.py b/tests/integration/ssh/test_state.py index 48f634f309f..2392d79c940 100644 --- a/tests/integration/ssh/test_state.py +++ b/tests/integration/ssh/test_state.py @@ -35,7 +35,7 @@ class SSHStateTest(SSHCase): def _check_request(self, empty=False): check = self.run_function("state.check_request", wipe=False) if empty: - self.assertFalse(bool(check), "bool({}) is not False".format(check)) + self.assertFalse(bool(check), f"bool({check}) is not False") else: self._check_dict_ret( ret=check["default"]["test_run"]["local"]["return"], diff --git a/tests/pytests/functional/states/test_npm.py b/tests/pytests/functional/states/test_npm.py index 500bd274498..81dd00f5544 100644 --- a/tests/pytests/functional/states/test_npm.py +++ b/tests/pytests/functional/states/test_npm.py @@ -23,7 +23,7 @@ def install_npm(states): # Just name the thing we're looking for states.npm # pylint: disable=pointless-statement except (CommandExecutionError, AttributeError, AssertionError) as exc: - pytest.skip("Unable to install npm - {}".format(exc)) + pytest.skip(f"Unable to install npm - {exc}") @pytest.fixture(scope="module") diff --git a/tests/pytests/integration/states/test_ansiblegate.py b/tests/pytests/integration/states/test_ansiblegate.py index 0b70a7ab138..ef08768b1c7 100644 --- a/tests/pytests/integration/states/test_ansiblegate.py +++ b/tests/pytests/integration/states/test_ansiblegate.py @@ -118,7 +118,7 @@ def test_ansible_playbook(salt_call_cli, ansible_inventory, tmp_path): except FactoryTimeout: log.debug("%s took longer than %s seconds", name, timeout) if timeout == timeouts[-1]: - pytest.fail("Failed to run {}".format(name)) + pytest.fail(f"Failed to run {name}") else: assert ret.returncode == 0 assert StateResult(ret.data).result is True From 68c6fd4fbad2ea72d3f2d2d54f332a7fa70c4869 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 14 Feb 2024 15:42:43 +0000 Subject: [PATCH 43/96] Increase timeouts on problematic tests --- tests/integration/modules/test_decorators.py | 1 + tests/integration/modules/test_saltcheck.py | 1 + tests/integration/ssh/test_state.py | 1 + tests/pytests/functional/modules/test_ansiblegate.py | 1 + tests/pytests/integration/cli/test_matcher.py | 1 + tests/pytests/integration/cli/test_salt_deltaproxy.py | 1 + 6 files changed, 6 insertions(+) diff --git a/tests/integration/modules/test_decorators.py b/tests/integration/modules/test_decorators.py index a3f83cd87c9..5a1ed3817a7 100644 --- a/tests/integration/modules/test_decorators.py +++ b/tests/integration/modules/test_decorators.py @@ -4,6 +4,7 @@ from tests.support.case import ModuleCase @pytest.mark.windows_whitelisted +@pytest.mark.timeout_unless_on_windows(120) class DecoratorTest(ModuleCase): @pytest.mark.slow_test def test_module(self): diff --git a/tests/integration/modules/test_saltcheck.py b/tests/integration/modules/test_saltcheck.py index 394d80bb8ab..914b046fdd7 100644 --- a/tests/integration/modules/test_saltcheck.py +++ b/tests/integration/modules/test_saltcheck.py @@ -7,6 +7,7 @@ import pytest from tests.support.case import ModuleCase +@pytest.mark.timeout_unless_on_windows(120) class SaltcheckModuleTest(ModuleCase): """ Test the saltcheck module diff --git a/tests/integration/ssh/test_state.py b/tests/integration/ssh/test_state.py index 48f634f309f..3951358b9e2 100644 --- a/tests/integration/ssh/test_state.py +++ b/tests/integration/ssh/test_state.py @@ -18,6 +18,7 @@ log = logging.getLogger(__name__) @pytest.mark.slow_test +@pytest.mark.timeout_unless_on_windows(120) class SSHStateTest(SSHCase): """ testing the state system with salt-ssh diff --git a/tests/pytests/functional/modules/test_ansiblegate.py b/tests/pytests/functional/modules/test_ansiblegate.py index 0c51b622709..9a895426a8c 100644 --- a/tests/pytests/functional/modules/test_ansiblegate.py +++ b/tests/pytests/functional/modules/test_ansiblegate.py @@ -10,6 +10,7 @@ pytestmark = [ reason="ansible is not installed", ), pytest.mark.slow_test, + pytest.mark.timeout_unless_on_windows(120), ] diff --git a/tests/pytests/integration/cli/test_matcher.py b/tests/pytests/integration/cli/test_matcher.py index 5d3ef4e3309..c1e8db062aa 100644 --- a/tests/pytests/integration/cli/test_matcher.py +++ b/tests/pytests/integration/cli/test_matcher.py @@ -7,6 +7,7 @@ import salt.defaults.exitcodes pytestmark = [ pytest.mark.core_test, pytest.mark.windows_whitelisted, + pytest.mark.timeout_unless_on_windows(120), ] diff --git a/tests/pytests/integration/cli/test_salt_deltaproxy.py b/tests/pytests/integration/cli/test_salt_deltaproxy.py index 5a6e847b78a..b1b65b3cacb 100644 --- a/tests/pytests/integration/cli/test_salt_deltaproxy.py +++ b/tests/pytests/integration/cli/test_salt_deltaproxy.py @@ -19,6 +19,7 @@ pytestmark = [ reason="Deltaproxy minions do not currently work on spawning platforms.", ), pytest.mark.core_test, + pytest.mark.timeout_unless_on_windows(320), ] From 6fa6c86a47d49f7bf8cdac3c70c1b2b8e515bb78 Mon Sep 17 00:00:00 2001 From: ScriptAutomate Date: Thu, 8 Feb 2024 10:48:59 -0600 Subject: [PATCH 44/96] Fix systemd scriptlet calls in RPMs --- changelog/65987.fixed.md | 1 + pkg/rpm/salt.spec | 43 +++++++++++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 changelog/65987.fixed.md diff --git a/changelog/65987.fixed.md b/changelog/65987.fixed.md new file mode 100644 index 00000000000..0a5fdff03d2 --- /dev/null +++ b/changelog/65987.fixed.md @@ -0,0 +1 @@ +Fix RPM package systemd scriptlets to make RPM packages more universal diff --git a/pkg/rpm/salt.spec b/pkg/rpm/salt.spec index 90fcfb0f37b..e98ee13d788 100644 --- a/pkg/rpm/salt.spec +++ b/pkg/rpm/salt.spec @@ -432,17 +432,25 @@ find /etc/salt /opt/saltstack/salt /var/log/salt /var/cache/salt /var/run/salt \ # assumes systemd for RHEL 7 & 8 & 9 +# foregoing %systemd_* scriptlets due to RHEL 7/8 vs. RHEL 9 incompatibilities +## - Using hardcoded scriptlet definitions from RHEL 7/8 that are forward-compatible %preun master # RHEL 9 is giving warning msg if syndic is not installed, supress it -%systemd_preun salt-syndic.service > /dev/null 2>&1 +# %systemd_preun salt-syndic.service > /dev/null 2>&1 +systemctl --no-reload disable salt-syndic.service > /dev/null 2>&1 || : +systemctl stop salt-syndic.service > /dev/null 2>&1 || : %preun minion -%systemd_preun salt-minion.service +# %systemd_preun salt-minion.service +systemctl --no-reload disable salt-minion.service > /dev/null 2>&1 || : +systemctl stop salt-minion.service > /dev/null 2>&1 || : %preun api -%systemd_preun salt-api.service +# %systemd_preun salt-api.service +systemctl --no-reload disable salt-api.service > /dev/null 2>&1 || : +systemctl stop salt-api.service > /dev/null 2>&1 || : %post @@ -456,7 +464,8 @@ ln -s -f /opt/saltstack/salt/salt-cloud %{_bindir}/salt-cloud %post master -%systemd_post salt-master.service +# %systemd_post salt-master.service +systemctl preset salt-master.service >/dev/null 2>&1 || : ln -s -f /opt/saltstack/salt/salt %{_bindir}/salt ln -s -f /opt/saltstack/salt/salt-cp %{_bindir}/salt-cp ln -s -f /opt/saltstack/salt/salt-key %{_bindir}/salt-key @@ -477,11 +486,13 @@ if [ $1 -lt 2 ]; then fi %post syndic -%systemd_post salt-syndic.service +# %systemd_post salt-syndic.service +systemctl preset salt-syndic.service >/dev/null 2>&1 || : ln -s -f /opt/saltstack/salt/salt-syndic %{_bindir}/salt-syndic %post minion -%systemd_post salt-minion.service +# %systemd_post salt-minion.service +systemctl preset salt-minion.service >/dev/null 2>&1 || : ln -s -f /opt/saltstack/salt/salt-minion %{_bindir}/salt-minion ln -s -f /opt/saltstack/salt/salt-call %{_bindir}/salt-call ln -s -f /opt/saltstack/salt/salt-proxy %{_bindir}/salt-proxy @@ -503,7 +514,8 @@ fi ln -s -f /opt/saltstack/salt/salt-ssh %{_bindir}/salt-ssh %post api -%systemd_post salt-api.service +# %systemd_post salt-api.service +systemctl preset salt-api.service >/dev/null 2>&1 || : ln -s -f /opt/saltstack/salt/salt-api %{_bindir}/salt-api @@ -544,7 +556,9 @@ if [ $1 -eq 0 ]; then fi %postun master -%systemd_postun_with_restart salt-master.service +# %systemd_postun_with_restart salt-master.service +systemctl daemon-reload >/dev/null 2>&1 || : +systemctl try-restart salt-master.service >/dev/null 2>&1 || : if [ $1 -eq 0 ]; then if [ $(cat /etc/os-release | grep VERSION_ID | cut -d '=' -f 2 | sed 's/\"//g' | cut -d '.' -f 1) = "8" ]; then if [ -z "$(rpm -qi salt-minion | grep Name | grep salt-minion)" ]; then @@ -560,10 +574,14 @@ if [ $1 -eq 0 ]; then fi %postun syndic -%systemd_postun_with_restart salt-syndic.service +# %systemd_postun_with_restart salt-syndic.service +systemctl daemon-reload >/dev/null 2>&1 || : +systemctl try-restart salt-syndic.service >/dev/null 2>&1 || : %postun minion -%systemd_postun_with_restart salt-minion.service +# %systemd_postun_with_restart salt-minion.service +systemctl daemon-reload >/dev/null 2>&1 || : +systemctl try-restart salt-minion.service >/dev/null 2>&1 || : if [ $1 -eq 0 ]; then if [ $(cat /etc/os-release | grep VERSION_ID | cut -d '=' -f 2 | sed 's/\"//g' | cut -d '.' -f 1) = "8" ]; then if [ -z "$(rpm -qi salt-master | grep Name | grep salt-master)" ]; then @@ -579,8 +597,9 @@ if [ $1 -eq 0 ]; then fi %postun api -%systemd_postun_with_restart salt-api.service - +# %systemd_postun_with_restart salt-api.service +systemctl daemon-reload >/dev/null 2>&1 || : +systemctl try-restart salt-api.service >/dev/null 2>&1 || : %changelog * Fri Jan 26 2024 Salt Project Packaging - 3006.6 From 0917a5abf78cc55b9db14765c2db47fadec0795a Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Fri, 9 Feb 2024 11:06:09 -0700 Subject: [PATCH 45/96] Update pkg upgrade/downgrade tests to check pids --- .../pkg/downgrade/test_salt_downgrade.py | 25 +++++++++++++++++ .../pytests/pkg/upgrade/test_salt_upgrade.py | 27 +++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/tests/pytests/pkg/downgrade/test_salt_downgrade.py b/tests/pytests/pkg/downgrade/test_salt_downgrade.py index f6a8ef17a23..ec090d17dda 100644 --- a/tests/pytests/pkg/downgrade/test_salt_downgrade.py +++ b/tests/pytests/pkg/downgrade/test_salt_downgrade.py @@ -1,4 +1,5 @@ import packaging.version +import psutil import pytest from pytestskipmarkers.utils import platform @@ -34,6 +35,19 @@ def test_salt_downgrade(salt_call_cli, install_salt): use_lib = salt_call_cli.run("--local", "github.get_repo_info", repo) assert "Authentication information could" in use_lib.stderr + # Verify there is a running minion by getting its PID + if platform.is_windows(): + process_name = "salt-minion.exe" + else: + process_name = "salt-minion" + old_pid = None + for proc in psutil.process_iter(): + if process_name in proc.name(): + if psutil.Process(proc.ppid()).name() != process_name: + old_pid = proc.pid + break + assert old_pid is not None + # Downgrade Salt to the previous version and test install_salt.install(downgrade=True) bin_file = "salt" @@ -45,6 +59,17 @@ def test_salt_downgrade(salt_call_cli, install_salt): elif platform.is_darwin() and install_salt.classic: bin_file = install_salt.bin_dir / "salt-call" + # Verify there is a new running minion by getting its PID and comparing it + # with the PID from before the upgrade + new_pid = None + for proc in psutil.process_iter(): + if process_name in proc.name(): + if psutil.Process(proc.ppid()).name() != process_name: + new_pid = proc.pid + break + assert new_pid is not None + assert new_pid != old_pid + ret = install_salt.proc.run(bin_file, "--version") assert ret.returncode == 0 assert packaging.version.parse( diff --git a/tests/pytests/pkg/upgrade/test_salt_upgrade.py b/tests/pytests/pkg/upgrade/test_salt_upgrade.py index d844b5807da..241a3c63d0f 100644 --- a/tests/pytests/pkg/upgrade/test_salt_upgrade.py +++ b/tests/pytests/pkg/upgrade/test_salt_upgrade.py @@ -1,5 +1,7 @@ import packaging.version +import psutil import pytest +from pytestskipmarkers.utils import platform def test_salt_upgrade(salt_call_cli, install_salt): @@ -29,6 +31,19 @@ def test_salt_upgrade(salt_call_cli, install_salt): use_lib = salt_call_cli.run("--local", "github.get_repo_info", repo) assert "Authentication information could" in use_lib.stderr + # Verify there is a running minion by getting its PID + if platform.is_windows(): + process_name = "salt-minion.exe" + else: + process_name = "salt-minion" + old_pid = None + for proc in psutil.process_iter(): + if process_name in proc.name(): + if psutil.Process(proc.ppid()).name() != process_name: + old_pid = proc.pid + break + assert old_pid is not None + # Upgrade Salt from previous version and test install_salt.install(upgrade=True) ret = salt_call_cli.run("test.version") @@ -37,8 +52,20 @@ def test_salt_upgrade(salt_call_cli, install_salt): install_salt.artifact_version ) + # Verify there is a new running minion by getting its PID and comparing it + # with the PID from before the upgrade + new_pid = None + for proc in psutil.process_iter(): + if process_name in proc.name(): + if psutil.Process(proc.ppid()).name() != process_name: + new_pid = proc.pid + break + assert new_pid is not None + assert new_pid != old_pid + if install_salt.relenv: new_py_version = install_salt.package_python_version() if new_py_version == original_py_version: # test pip install after an upgrade use_lib = salt_call_cli.run("--local", "github.get_repo_info", repo) + assert "Authentication information could" in use_lib.stderr From 0021cb870df20a4e583053b1bb6326fff7b3ee58 Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Mon, 12 Feb 2024 15:00:45 -0700 Subject: [PATCH 46/96] Fix the spec file for RPMs Looked up the actual code for the macros being replaced Made sure we're doing the proper if statements Cleaned up the tests a little --- pkg/rpm/salt.spec | 62 ++++++++++++++----- .../pkg/integration/test_enabled_disabled.py | 6 +- 2 files changed, 49 insertions(+), 19 deletions(-) diff --git a/pkg/rpm/salt.spec b/pkg/rpm/salt.spec index e98ee13d788..4da0d4535ed 100644 --- a/pkg/rpm/salt.spec +++ b/pkg/rpm/salt.spec @@ -437,20 +437,28 @@ find /etc/salt /opt/saltstack/salt /var/log/salt /var/cache/salt /var/run/salt \ %preun master # RHEL 9 is giving warning msg if syndic is not installed, supress it # %systemd_preun salt-syndic.service > /dev/null 2>&1 -systemctl --no-reload disable salt-syndic.service > /dev/null 2>&1 || : -systemctl stop salt-syndic.service > /dev/null 2>&1 || : - +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + systemctl --no-reload disable salt-syndic.service > /dev/null 2>&1 || : + systemctl stop salt-syndic.service > /dev/null 2>&1 || : +fi %preun minion # %systemd_preun salt-minion.service -systemctl --no-reload disable salt-minion.service > /dev/null 2>&1 || : -systemctl stop salt-minion.service > /dev/null 2>&1 || : +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + systemctl --no-reload disable salt-minion.service > /dev/null 2>&1 || : + systemctl stop salt-minion.service > /dev/null 2>&1 || : +fi %preun api # %systemd_preun salt-api.service -systemctl --no-reload disable salt-api.service > /dev/null 2>&1 || : -systemctl stop salt-api.service > /dev/null 2>&1 || : +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + systemctl --no-reload disable salt-api.service > /dev/null 2>&1 || : + systemctl stop salt-api.service > /dev/null 2>&1 || : +fi %post @@ -465,7 +473,10 @@ ln -s -f /opt/saltstack/salt/salt-cloud %{_bindir}/salt-cloud %post master # %systemd_post salt-master.service -systemctl preset salt-master.service >/dev/null 2>&1 || : +if [ $1 -eq 1 ] ; then + # Initial installation + systemctl preset salt-master.service >/dev/null 2>&1 || : +fi ln -s -f /opt/saltstack/salt/salt %{_bindir}/salt ln -s -f /opt/saltstack/salt/salt-cp %{_bindir}/salt-cp ln -s -f /opt/saltstack/salt/salt-key %{_bindir}/salt-key @@ -487,12 +498,18 @@ fi %post syndic # %systemd_post salt-syndic.service -systemctl preset salt-syndic.service >/dev/null 2>&1 || : +if [ $1 -eq 1 ] ; then + # Initial installation + systemctl preset salt-syndic.service >/dev/null 2>&1 || : +fi ln -s -f /opt/saltstack/salt/salt-syndic %{_bindir}/salt-syndic %post minion # %systemd_post salt-minion.service -systemctl preset salt-minion.service >/dev/null 2>&1 || : +if [ $1 -eq 1 ] ; then + # Initial installation + systemctl preset salt-minion.service >/dev/null 2>&1 || : +fi ln -s -f /opt/saltstack/salt/salt-minion %{_bindir}/salt-minion ln -s -f /opt/saltstack/salt/salt-call %{_bindir}/salt-call ln -s -f /opt/saltstack/salt/salt-proxy %{_bindir}/salt-proxy @@ -515,7 +532,10 @@ ln -s -f /opt/saltstack/salt/salt-ssh %{_bindir}/salt-ssh %post api # %systemd_post salt-api.service -systemctl preset salt-api.service >/dev/null 2>&1 || : +if [ $1 -eq 1 ] ; then + # Initial installation + systemctl preset salt-api.service >/dev/null 2>&1 || : +fi ln -s -f /opt/saltstack/salt/salt-api %{_bindir}/salt-api @@ -558,7 +578,10 @@ fi %postun master # %systemd_postun_with_restart salt-master.service systemctl daemon-reload >/dev/null 2>&1 || : -systemctl try-restart salt-master.service >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + systemctl try-restart salt-master.service >/dev/null 2>&1 || : +fi if [ $1 -eq 0 ]; then if [ $(cat /etc/os-release | grep VERSION_ID | cut -d '=' -f 2 | sed 's/\"//g' | cut -d '.' -f 1) = "8" ]; then if [ -z "$(rpm -qi salt-minion | grep Name | grep salt-minion)" ]; then @@ -576,12 +599,18 @@ fi %postun syndic # %systemd_postun_with_restart salt-syndic.service systemctl daemon-reload >/dev/null 2>&1 || : -systemctl try-restart salt-syndic.service >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + systemctl try-restart salt-syndic.service >/dev/null 2>&1 || : +fi %postun minion # %systemd_postun_with_restart salt-minion.service systemctl daemon-reload >/dev/null 2>&1 || : -systemctl try-restart salt-minion.service >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + systemctl try-restart salt-minion.service >/dev/null 2>&1 || : +fi if [ $1 -eq 0 ]; then if [ $(cat /etc/os-release | grep VERSION_ID | cut -d '=' -f 2 | sed 's/\"//g' | cut -d '.' -f 1) = "8" ]; then if [ -z "$(rpm -qi salt-master | grep Name | grep salt-master)" ]; then @@ -599,7 +628,10 @@ fi %postun api # %systemd_postun_with_restart salt-api.service systemctl daemon-reload >/dev/null 2>&1 || : -systemctl try-restart salt-api.service >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + systemctl try-restart salt-api.service >/dev/null 2>&1 || : +fi %changelog * Fri Jan 26 2024 Salt Project Packaging - 3006.6 diff --git a/tests/pytests/pkg/integration/test_enabled_disabled.py b/tests/pytests/pkg/integration/test_enabled_disabled.py index c6f0d75db8f..f08c1e34a44 100644 --- a/tests/pytests/pkg/integration/test_enabled_disabled.py +++ b/tests/pytests/pkg/integration/test_enabled_disabled.py @@ -7,15 +7,14 @@ def test_services(install_salt, salt_cli, salt_minion): """ Check if Services are enabled/disabled """ + services_disabled = [] + services_enabled = [] if install_salt.distro_id in ("ubuntu", "debian"): services_enabled = ["salt-master", "salt-minion", "salt-syndic", "salt-api"] - services_disabled = [] elif install_salt.distro_id in ("centos", "redhat", "amzn", "fedora"): - services_enabled = [] services_disabled = ["salt-master", "salt-minion", "salt-syndic", "salt-api"] elif install_salt.distro_id == "photon": if float(install_salt.distro_version) < 5: - services_enabled = [] services_disabled = [ "salt-master", "salt-minion", @@ -24,7 +23,6 @@ def test_services(install_salt, salt_cli, salt_minion): ] else: services_enabled = ["salt-master", "salt-minion", "salt-syndic", "salt-api"] - services_disabled = [] elif platform.is_darwin(): services_enabled = ["salt-minion"] services_disabled = [] From 89570462687440418e925c29d0b602b244302190 Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Tue, 13 Feb 2024 08:06:09 -0700 Subject: [PATCH 47/96] Make Photon 3 & 4 tests like Photon 5 --- tests/pytests/pkg/integration/test_enabled_disabled.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tests/pytests/pkg/integration/test_enabled_disabled.py b/tests/pytests/pkg/integration/test_enabled_disabled.py index f08c1e34a44..b2293492701 100644 --- a/tests/pytests/pkg/integration/test_enabled_disabled.py +++ b/tests/pytests/pkg/integration/test_enabled_disabled.py @@ -14,15 +14,7 @@ def test_services(install_salt, salt_cli, salt_minion): elif install_salt.distro_id in ("centos", "redhat", "amzn", "fedora"): services_disabled = ["salt-master", "salt-minion", "salt-syndic", "salt-api"] elif install_salt.distro_id == "photon": - if float(install_salt.distro_version) < 5: - services_disabled = [ - "salt-master", - "salt-minion", - "salt-syndic", - "salt-api", - ] - else: - services_enabled = ["salt-master", "salt-minion", "salt-syndic", "salt-api"] + services_enabled = ["salt-master", "salt-minion", "salt-syndic", "salt-api"] elif platform.is_darwin(): services_enabled = ["salt-minion"] services_disabled = [] From 62a58e3cca946641cad77a12ca08e7bfab642a1f Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Wed, 14 Feb 2024 11:15:51 -0700 Subject: [PATCH 48/96] Handle upgrade scenario --- pkg/rpm/salt.spec | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/pkg/rpm/salt.spec b/pkg/rpm/salt.spec index 4da0d4535ed..4053921d366 100644 --- a/pkg/rpm/salt.spec +++ b/pkg/rpm/salt.spec @@ -436,7 +436,7 @@ find /etc/salt /opt/saltstack/salt /var/log/salt /var/cache/salt /var/run/salt \ ## - Using hardcoded scriptlet definitions from RHEL 7/8 that are forward-compatible %preun master # RHEL 9 is giving warning msg if syndic is not installed, supress it -# %systemd_preun salt-syndic.service > /dev/null 2>&1 +# %%systemd_preun salt-syndic.service > /dev/null 2>&1 if [ $1 -eq 0 ] ; then # Package removal, not upgrade systemctl --no-reload disable salt-syndic.service > /dev/null 2>&1 || : @@ -444,7 +444,7 @@ if [ $1 -eq 0 ] ; then fi %preun minion -# %systemd_preun salt-minion.service +# %%systemd_preun salt-minion.service if [ $1 -eq 0 ] ; then # Package removal, not upgrade systemctl --no-reload disable salt-minion.service > /dev/null 2>&1 || : @@ -453,7 +453,7 @@ fi %preun api -# %systemd_preun salt-api.service +# %%systemd_preun salt-api.service if [ $1 -eq 0 ] ; then # Package removal, not upgrade systemctl --no-reload disable salt-api.service > /dev/null 2>&1 || : @@ -472,8 +472,11 @@ ln -s -f /opt/saltstack/salt/salt-cloud %{_bindir}/salt-cloud %post master -# %systemd_post salt-master.service -if [ $1 -eq 1 ] ; then +# %%systemd_post salt-master.service +if [ $1 -gt 1 ] ; then + # Upgrade + systemctl retry-restart salt-master.service >/dev/null 2>&1 || : +else # Initial installation systemctl preset salt-master.service >/dev/null 2>&1 || : fi @@ -497,16 +500,22 @@ if [ $1 -lt 2 ]; then fi %post syndic -# %systemd_post salt-syndic.service -if [ $1 -eq 1 ] ; then +# %%systemd_post salt-syndic.service +if [ $1 -gt 1 ] ; then + # Upgrade + systemctl retry-restart salt-syndic.service >/dev/null 2>&1 || : +else # Initial installation systemctl preset salt-syndic.service >/dev/null 2>&1 || : fi ln -s -f /opt/saltstack/salt/salt-syndic %{_bindir}/salt-syndic %post minion -# %systemd_post salt-minion.service -if [ $1 -eq 1 ] ; then +# %%systemd_post salt-minion.service +if [ $1 -gt 1 ] ; then + # Upgrade + systemctl retry-restart salt-minion.service >/dev/null 2>&1 || : +else # Initial installation systemctl preset salt-minion.service >/dev/null 2>&1 || : fi @@ -531,8 +540,11 @@ fi ln -s -f /opt/saltstack/salt/salt-ssh %{_bindir}/salt-ssh %post api -# %systemd_post salt-api.service -if [ $1 -eq 1 ] ; then +# %%systemd_post salt-api.service +if [ $1 -gt 1 ] ; then + # Upgrade + systemctl retry-restart salt-api.service >/dev/null 2>&1 || : +else # Initial installation systemctl preset salt-api.service >/dev/null 2>&1 || : fi @@ -576,7 +588,7 @@ if [ $1 -eq 0 ]; then fi %postun master -# %systemd_postun_with_restart salt-master.service +# %%systemd_postun_with_restart salt-master.service systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall @@ -597,7 +609,7 @@ if [ $1 -eq 0 ]; then fi %postun syndic -# %systemd_postun_with_restart salt-syndic.service +# %%systemd_postun_with_restart salt-syndic.service systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall @@ -605,7 +617,7 @@ if [ $1 -ge 1 ] ; then fi %postun minion -# %systemd_postun_with_restart salt-minion.service +# %%systemd_postun_with_restart salt-minion.service systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall @@ -626,7 +638,7 @@ if [ $1 -eq 0 ]; then fi %postun api -# %systemd_postun_with_restart salt-api.service +# %%systemd_postun_with_restart salt-api.service systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall From 9a04397c11c976f28d3537b064084a47f0918c95 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Mon, 12 Feb 2024 18:58:28 -0600 Subject: [PATCH 49/96] [3006.x] Clarify that state.apply with no arguments runs a highstate --- salt/modules/state.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/salt/modules/state.py b/salt/modules/state.py index 72baf47f488..ca86bcc62dc 100644 --- a/salt/modules/state.py +++ b/salt/modules/state.py @@ -637,7 +637,8 @@ def apply_(mods=None, **kwargs): .. rubric:: APPLYING ALL STATES CONFIGURED IN TOP.SLS (A.K.A. :ref:`HIGHSTATE `) - To apply all configured states, simply run ``state.apply``: + To apply all configured states, simply run ``state.apply`` with no SLS + targets, like so: .. code-block:: bash From 332533b1c958c24470bc4d9238216bcd431db901 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 14 Feb 2024 00:55:36 -0700 Subject: [PATCH 50/96] Fix default request channel timeout regression --- changelog/66061.fixed.md | 2 ++ salt/config/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog/66061.fixed.md diff --git a/changelog/66061.fixed.md b/changelog/66061.fixed.md new file mode 100644 index 00000000000..1735b25b2a4 --- /dev/null +++ b/changelog/66061.fixed.md @@ -0,0 +1,2 @@ +Fix request channel default timeout regression. In 3006.5 it was changed from +60 to 30 and is now set back to 60 by default. diff --git a/salt/config/__init__.py b/salt/config/__init__.py index 688cc5ea455..95a4de9e09a 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py @@ -1057,7 +1057,7 @@ DEFAULT_MINION_OPTS = immutabletypes.freeze( "pillar_cache": False, "pillar_cache_ttl": 3600, "pillar_cache_backend": "disk", - "request_channel_timeout": 30, + "request_channel_timeout": 60, "request_channel_tries": 3, "gpg_cache": False, "gpg_cache_ttl": 86400, From 056a77cca8935e296493cf388d538d3937670b5f Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 14 Feb 2024 00:57:39 -0700 Subject: [PATCH 51/96] Add missing changelog for 65932 --- changelog/65932.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/65932.fixed.md diff --git a/changelog/65932.fixed.md b/changelog/65932.fixed.md new file mode 100644 index 00000000000..cafb2bb0022 --- /dev/null +++ b/changelog/65932.fixed.md @@ -0,0 +1 @@ +Ensure minion channels are closed on any master connection error. From c6274471cf209cbfb35359471b4c7c1f667085df Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Tue, 6 Feb 2024 17:15:40 +0000 Subject: [PATCH 52/96] the fix for grabbing just our events and not sseapes --- salt/client/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/client/__init__.py b/salt/client/__init__.py index 307ce8a0ad4..ebfbea48e7a 100644 --- a/salt/client/__init__.py +++ b/salt/client/__init__.py @@ -1204,7 +1204,7 @@ class LocalClient: continue # Anything below this point is expected to be a job return event. - if not raw["tag"].startswith(f"salt/job/{jid}/ret"): + if not raw["tag"].startswith(f"salt/job/{jid}/ret/"): log.debug("Skipping non return event: %s", raw["tag"]) continue if "return" not in raw["data"]: From 2dd0f2966335b1815e8073dfb5a4310a6bafa4a5 Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Tue, 6 Feb 2024 17:18:57 +0000 Subject: [PATCH 53/96] add changelog --- changelog/65727.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/65727.fixed.md diff --git a/changelog/65727.fixed.md b/changelog/65727.fixed.md new file mode 100644 index 00000000000..fe507ce4f8c --- /dev/null +++ b/changelog/65727.fixed.md @@ -0,0 +1 @@ +catch only ret/ events not all returning events. From da31638f0a83da36b4057cc99cbef1e3cbd91d9a Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Thu, 8 Feb 2024 14:17:40 -0700 Subject: [PATCH 54/96] Add test for return fix --- tests/pytests/unit/test_client.py | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/pytests/unit/test_client.py b/tests/pytests/unit/test_client.py index 48a21873697..fde31f459fb 100644 --- a/tests/pytests/unit/test_client.py +++ b/tests/pytests/unit/test_client.py @@ -247,3 +247,44 @@ def test_pub_win32(salt_master_factory): "test.ping", tgt_type="nodegroup", ) + + +def test_invalid_event_tag_65727(master_opts, caplog): + """ + LocalClient.get_iter_returns handles non return event tags. + """ + minions = () + jid = "0815" + raw_return = {"id": "fake-id", "jid": jid, "data": "", "return": "fake-return"} + expected_return = {"fake-id": {"ret": "fake-return"}} + + def returns_iter(): + # Invalid return + yield { + "tag": "salt/job/0815/return/", + "data": { + "return": "fpp", + "id": "fake-id", + }, + } + # Valid return + yield { + "tag": "salt/job/0815/ret/", + "data": { + "return": "fpp", + "id": "fake-id", + }, + } + + with client.LocalClient(mopts=master_opts) as local_client: + # Returning a truthy value, the real method returns a salt returner but it's not used. + local_client.returns_for_job = MagicMock(return_value=True) + # Mock iter returns, we'll return one invalid and one valid return event. + local_client.get_returns_no_block = MagicMock(return_value=returns_iter()) + with caplog.at_level(logging.DEBUG): + # Validate we don't choke on the bad return, the method returns a + # valid respons and the invalid event tag is getting logged to + # debug. + for ret in local_client.get_iter_returns(jid, {"fake-id"}): + assert ret == {"fake-id": {"ret": "fpp"}} + assert "Skipping non return event: salt/job/0815/return/" in caplog.text From b27ae54c12429d0476ca9c96da8a263c8bdc8db7 Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Fri, 9 Feb 2024 20:23:26 +0000 Subject: [PATCH 55/96] fix tests/pytests/functional/cli/test_batch.py::test_batch_issue_56273 --- tests/pytests/functional/cli/test_batch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytests/functional/cli/test_batch.py b/tests/pytests/functional/cli/test_batch.py index e721b729cfe..8c69b48cf4a 100644 --- a/tests/pytests/functional/cli/test_batch.py +++ b/tests/pytests/functional/cli/test_batch.py @@ -140,7 +140,7 @@ class MockSubscriber: }, use_bin_type=True, ) - tag = "salt/job/{}/ret".format(jid).encode() + tag = f"salt/job/{jid}/ret/{minion_id}".encode() return b"".join([tag, b"\n\n", dumped]) def connect(self, timeout=None): From 7f29337f70dfd9073b4e340117875b69b5f58cc3 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 15 Feb 2024 13:57:02 +0000 Subject: [PATCH 56/96] Bump to `pyzmq==25.1.2` to hopefully address some build issues on MacOS --- requirements/static/ci/py3.10/darwin.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 2 +- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.11/darwin.txt | 2 +- requirements/static/ci/py3.11/freebsd.txt | 2 +- requirements/static/ci/py3.11/linux.txt | 2 +- requirements/static/ci/py3.11/windows.txt | 2 +- requirements/static/ci/py3.12/cloud.txt | 2 +- requirements/static/ci/py3.12/darwin.txt | 2 +- requirements/static/ci/py3.12/docs.txt | 2 +- requirements/static/ci/py3.12/freebsd.txt | 2 +- requirements/static/ci/py3.12/lint.txt | 2 +- requirements/static/ci/py3.12/linux.txt | 2 +- requirements/static/ci/py3.12/windows.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/darwin.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- requirements/static/pkg/py3.10/darwin.txt | 2 +- requirements/static/pkg/py3.10/freebsd.txt | 2 +- requirements/static/pkg/py3.10/linux.txt | 2 +- requirements/static/pkg/py3.10/windows.txt | 2 +- requirements/static/pkg/py3.11/darwin.txt | 2 +- requirements/static/pkg/py3.11/freebsd.txt | 2 +- requirements/static/pkg/py3.11/linux.txt | 2 +- requirements/static/pkg/py3.11/windows.txt | 2 +- requirements/static/pkg/py3.12/darwin.txt | 2 +- requirements/static/pkg/py3.12/freebsd.txt | 2 +- requirements/static/pkg/py3.12/linux.txt | 2 +- requirements/static/pkg/py3.12/windows.txt | 2 +- requirements/static/pkg/py3.8/freebsd.txt | 2 +- requirements/static/pkg/py3.8/linux.txt | 2 +- requirements/static/pkg/py3.8/windows.txt | 2 +- requirements/static/pkg/py3.9/darwin.txt | 2 +- requirements/static/pkg/py3.9/freebsd.txt | 2 +- requirements/static/pkg/py3.9/linux.txt | 2 +- requirements/static/pkg/py3.9/windows.txt | 2 +- 41 files changed, 41 insertions(+), 41 deletions(-) diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index d2081ea9db4..5bf1bbba951 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -422,7 +422,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.10/darwin.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index cef4ae7307c..90be309730e 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -426,7 +426,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.10/freebsd.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index bc78a4b6dce..13131285e69 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -466,7 +466,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.10/linux.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index a306f8c2a83..ed4cdf86de9 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -386,7 +386,7 @@ pyyaml==6.0.1 # pytest-salt-factories # responses # yamllint -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.10/windows.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.11/darwin.txt b/requirements/static/ci/py3.11/darwin.txt index 395cbed10a9..aff933e69f3 100644 --- a/requirements/static/ci/py3.11/darwin.txt +++ b/requirements/static/ci/py3.11/darwin.txt @@ -424,7 +424,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.11/darwin.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index ea3d34269d2..04a1cd6bafc 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -428,7 +428,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.11/freebsd.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index 11120f3e613..0bf4464a642 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -466,7 +466,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.11/linux.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index ec2db167da2..04e7d9ee589 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -388,7 +388,7 @@ pyyaml==6.0.1 # pytest-salt-factories # responses # yamllint -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.11/windows.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.12/cloud.txt b/requirements/static/ci/py3.12/cloud.txt index c339f8c3de5..1369ec30fd0 100644 --- a/requirements/static/ci/py3.12/cloud.txt +++ b/requirements/static/ci/py3.12/cloud.txt @@ -603,7 +603,7 @@ pyyaml==6.0.1 # pytest-salt-factories # responses # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt # -c requirements/static/ci/py3.12/linux.txt diff --git a/requirements/static/ci/py3.12/darwin.txt b/requirements/static/ci/py3.12/darwin.txt index 71c5e925022..0cae3e990e3 100644 --- a/requirements/static/ci/py3.12/darwin.txt +++ b/requirements/static/ci/py3.12/darwin.txt @@ -424,7 +424,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.12/darwin.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.12/docs.txt b/requirements/static/ci/py3.12/docs.txt index b5151d34354..87c2b1f5a42 100644 --- a/requirements/static/ci/py3.12/docs.txt +++ b/requirements/static/ci/py3.12/docs.txt @@ -208,7 +208,7 @@ pyyaml==6.0.1 # -c requirements/static/ci/py3.12/linux.txt # -r requirements/base.txt # myst-docutils -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/py3.12/linux.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.12/freebsd.txt b/requirements/static/ci/py3.12/freebsd.txt index bdb78c1e94b..b24db2e8f82 100644 --- a/requirements/static/ci/py3.12/freebsd.txt +++ b/requirements/static/ci/py3.12/freebsd.txt @@ -428,7 +428,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.12/freebsd.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.12/lint.txt b/requirements/static/ci/py3.12/lint.txt index d7177003782..8c754585ba4 100644 --- a/requirements/static/ci/py3.12/lint.txt +++ b/requirements/static/ci/py3.12/lint.txt @@ -588,7 +588,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt # -c requirements/static/ci/py3.12/linux.txt diff --git a/requirements/static/ci/py3.12/linux.txt b/requirements/static/ci/py3.12/linux.txt index 00b78596fc8..50a4c6430be 100644 --- a/requirements/static/ci/py3.12/linux.txt +++ b/requirements/static/ci/py3.12/linux.txt @@ -466,7 +466,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.12/windows.txt b/requirements/static/ci/py3.12/windows.txt index 872e68e4bda..bef8716d882 100644 --- a/requirements/static/ci/py3.12/windows.txt +++ b/requirements/static/ci/py3.12/windows.txt @@ -388,7 +388,7 @@ pyyaml==6.0.1 # pytest-salt-factories # responses # yamllint -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.12/windows.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index f74ae539955..97217ba0d79 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -430,7 +430,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.8/freebsd.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index b79e8982ad9..4099c1362e4 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -462,7 +462,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 79d2fb72d24..7e14e8cfcc9 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -391,7 +391,7 @@ pyyaml==6.0.1 # pytest-salt-factories # responses # yamllint -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.8/windows.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 27fd22c1165..b433ac25361 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -422,7 +422,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.9/darwin.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index d93832f863b..59247cd0d69 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -426,7 +426,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.9/freebsd.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index 8e545c3af5f..83c919d26fa 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -458,7 +458,7 @@ pyyaml==6.0.1 # responses # yamllint # yamlordereddictloader -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.9/linux.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 0ba98deed0c..f6b2fd7f0e4 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -387,7 +387,7 @@ pyyaml==6.0.1 # pytest-salt-factories # responses # yamllint -pyzmq==25.1.1 +pyzmq==25.1.2 # via # -c requirements/static/ci/../pkg/py3.9/windows.txt # -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.10/darwin.txt b/requirements/static/pkg/py3.10/darwin.txt index 8a320f8420f..4db29970e05 100644 --- a/requirements/static/pkg/py3.10/darwin.txt +++ b/requirements/static/pkg/py3.10/darwin.txt @@ -101,7 +101,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.10/freebsd.txt b/requirements/static/pkg/py3.10/freebsd.txt index 5a7f8f6e781..9c63b2887bc 100644 --- a/requirements/static/pkg/py3.10/freebsd.txt +++ b/requirements/static/pkg/py3.10/freebsd.txt @@ -101,7 +101,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.10/linux.txt b/requirements/static/pkg/py3.10/linux.txt index 45d43f4c769..d6da01be4a9 100644 --- a/requirements/static/pkg/py3.10/linux.txt +++ b/requirements/static/pkg/py3.10/linux.txt @@ -101,7 +101,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.10/windows.txt b/requirements/static/pkg/py3.10/windows.txt index a095837a160..9f4c1dc33ab 100644 --- a/requirements/static/pkg/py3.10/windows.txt +++ b/requirements/static/pkg/py3.10/windows.txt @@ -117,7 +117,7 @@ pywin32==306 ; sys_platform == "win32" # wmi pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.11/darwin.txt b/requirements/static/pkg/py3.11/darwin.txt index 94a4e32158e..9041fddb088 100644 --- a/requirements/static/pkg/py3.11/darwin.txt +++ b/requirements/static/pkg/py3.11/darwin.txt @@ -103,7 +103,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.11/freebsd.txt b/requirements/static/pkg/py3.11/freebsd.txt index b07d40334bd..e8795865e38 100644 --- a/requirements/static/pkg/py3.11/freebsd.txt +++ b/requirements/static/pkg/py3.11/freebsd.txt @@ -103,7 +103,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.11/linux.txt b/requirements/static/pkg/py3.11/linux.txt index 8a9ac8bdcf4..739d80c8e00 100644 --- a/requirements/static/pkg/py3.11/linux.txt +++ b/requirements/static/pkg/py3.11/linux.txt @@ -103,7 +103,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.11/windows.txt b/requirements/static/pkg/py3.11/windows.txt index 9fe65a03c4a..b8829de7a0c 100644 --- a/requirements/static/pkg/py3.11/windows.txt +++ b/requirements/static/pkg/py3.11/windows.txt @@ -119,7 +119,7 @@ pywin32==306 ; sys_platform == "win32" # wmi pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.12/darwin.txt b/requirements/static/pkg/py3.12/darwin.txt index 7dd3c51472e..614533fecab 100644 --- a/requirements/static/pkg/py3.12/darwin.txt +++ b/requirements/static/pkg/py3.12/darwin.txt @@ -103,7 +103,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.12/freebsd.txt b/requirements/static/pkg/py3.12/freebsd.txt index ce30a1fdf08..a4e3355ea9e 100644 --- a/requirements/static/pkg/py3.12/freebsd.txt +++ b/requirements/static/pkg/py3.12/freebsd.txt @@ -103,7 +103,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.12/linux.txt b/requirements/static/pkg/py3.12/linux.txt index afdd871dd02..609869f789e 100644 --- a/requirements/static/pkg/py3.12/linux.txt +++ b/requirements/static/pkg/py3.12/linux.txt @@ -103,7 +103,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.12/windows.txt b/requirements/static/pkg/py3.12/windows.txt index e869f10f683..066f4a05813 100644 --- a/requirements/static/pkg/py3.12/windows.txt +++ b/requirements/static/pkg/py3.12/windows.txt @@ -119,7 +119,7 @@ pywin32==306 ; sys_platform == "win32" # wmi pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.8/freebsd.txt b/requirements/static/pkg/py3.8/freebsd.txt index f09cbffb704..6a07f62f864 100644 --- a/requirements/static/pkg/py3.8/freebsd.txt +++ b/requirements/static/pkg/py3.8/freebsd.txt @@ -103,7 +103,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.8/linux.txt b/requirements/static/pkg/py3.8/linux.txt index a8b35a27ef3..987c6041c42 100644 --- a/requirements/static/pkg/py3.8/linux.txt +++ b/requirements/static/pkg/py3.8/linux.txt @@ -103,7 +103,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.8/windows.txt b/requirements/static/pkg/py3.8/windows.txt index 67145ab3c18..061d471f65f 100644 --- a/requirements/static/pkg/py3.8/windows.txt +++ b/requirements/static/pkg/py3.8/windows.txt @@ -120,7 +120,7 @@ pywin32==306 ; sys_platform == "win32" # wmi pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.9/darwin.txt b/requirements/static/pkg/py3.9/darwin.txt index a1137553d70..79d2af35363 100644 --- a/requirements/static/pkg/py3.9/darwin.txt +++ b/requirements/static/pkg/py3.9/darwin.txt @@ -101,7 +101,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.9/freebsd.txt b/requirements/static/pkg/py3.9/freebsd.txt index e4e83909f16..b8e87b30c62 100644 --- a/requirements/static/pkg/py3.9/freebsd.txt +++ b/requirements/static/pkg/py3.9/freebsd.txt @@ -101,7 +101,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.9/linux.txt b/requirements/static/pkg/py3.9/linux.txt index 431ba64dfca..73492847c6e 100644 --- a/requirements/static/pkg/py3.9/linux.txt +++ b/requirements/static/pkg/py3.9/linux.txt @@ -101,7 +101,7 @@ pytz==2024.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt diff --git a/requirements/static/pkg/py3.9/windows.txt b/requirements/static/pkg/py3.9/windows.txt index c14975133c1..2ac8d013f09 100644 --- a/requirements/static/pkg/py3.9/windows.txt +++ b/requirements/static/pkg/py3.9/windows.txt @@ -118,7 +118,7 @@ pywin32==306 ; sys_platform == "win32" # wmi pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==25.1.1 +pyzmq==25.1.2 # via -r requirements/zeromq.txt requests==2.31.0 # via -r requirements/base.txt From 2b565f770aea4fdfb869607e19256de9110a5849 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 15 Feb 2024 14:06:16 +0000 Subject: [PATCH 57/96] Run `pyupgrade` against the files modified in the merge-forward --- salt/modules/state.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/salt/modules/state.py b/salt/modules/state.py index ca86bcc62dc..6f23b6f2db3 100644 --- a/salt/modules/state.py +++ b/salt/modules/state.py @@ -145,7 +145,7 @@ def _snapper_pre(opts, jid): snapper_pre = __salt__["snapper.create_snapshot"]( config=__opts__.get("snapper_states_config", "root"), snapshot_type="pre", - description="Salt State run for jid {}".format(jid), + description=f"Salt State run for jid {jid}", __pub_jid=jid, ) except Exception: # pylint: disable=broad-except @@ -164,7 +164,7 @@ def _snapper_post(opts, jid, pre_num): config=__opts__.get("snapper_states_config", "root"), snapshot_type="post", pre_number=pre_num, - description="Salt State run for jid {}".format(jid), + description=f"Salt State run for jid {jid}", __pub_jid=jid, ) except Exception: # pylint: disable=broad-except @@ -587,7 +587,7 @@ def template(tem, queue=None, **kwargs): raise CommandExecutionError("Pillar failed to render", info=errors) if not tem.endswith(".sls"): - tem = "{sls}.sls".format(sls=tem) + tem = f"{tem}.sls" high_state, errors = st_.render_state( tem, kwargs.get("saltenv", ""), "", None, local=True ) @@ -883,7 +883,7 @@ def request(mods=None, **kwargs): try: if salt.utils.platform.is_windows(): # Make sure cache file isn't read-only - __salt__["cmd.run"]('attrib -R "{}"'.format(notify_path)) + __salt__["cmd.run"](f'attrib -R "{notify_path}"') with salt.utils.files.fopen(notify_path, "w+b") as fp_: salt.payload.dump(req, fp_) except OSError: @@ -945,7 +945,7 @@ def clear_request(name=None): try: if salt.utils.platform.is_windows(): # Make sure cache file isn't read-only - __salt__["cmd.run"]('attrib -R "{}"'.format(notify_path)) + __salt__["cmd.run"](f'attrib -R "{notify_path}"') with salt.utils.files.fopen(notify_path, "w+b") as fp_: salt.payload.dump(req, fp_) except OSError: @@ -1215,7 +1215,7 @@ def sls( queue=None, sync_mods=None, state_events=None, - **kwargs + **kwargs, ): """ Execute the states in one or more SLS files @@ -1414,7 +1414,7 @@ def sls( for module_type in sync_mods: try: - __salt__["saltutil.sync_{}".format(module_type)](saltenv=opts["saltenv"]) + __salt__[f"saltutil.sync_{module_type}"](saltenv=opts["saltenv"]) except KeyError: log.warning("Invalid custom module type '%s', ignoring", module_type) @@ -2340,10 +2340,10 @@ def pkg(pkg_path, pkg_sum, hash_type, test=None, **kwargs): members = s_pkg.getmembers() for member in members: if salt.utils.stringutils.to_unicode(member.path).startswith( - (os.sep, "..{}".format(os.sep)) + (os.sep, f"..{os.sep}") ): return {} - elif "..{}".format(os.sep) in salt.utils.stringutils.to_unicode(member.path): + elif f"..{os.sep}" in salt.utils.stringutils.to_unicode(member.path): return {} s_pkg.extractall(root) s_pkg.close() @@ -2421,9 +2421,9 @@ def disable(states): _changed = False for _state in states: if _state in _disabled_state_runs: - msg.append("Info: {} state already disabled.".format(_state)) + msg.append(f"Info: {_state} state already disabled.") else: - msg.append("Info: {} state disabled.".format(_state)) + msg.append(f"Info: {_state} state disabled.") _disabled_state_runs.append(_state) _changed = True @@ -2471,9 +2471,9 @@ def enable(states): for _state in states: log.debug("_state %s", _state) if _state not in _disabled_state_runs: - msg.append("Info: {} state already enabled.".format(_state)) + msg.append(f"Info: {_state} state already enabled.") else: - msg.append("Info: {} state enabled.".format(_state)) + msg.append(f"Info: {_state} state enabled.") _disabled_state_runs.remove(_state) _changed = True From 8b1002270277eec226e6e89910182c36c81ebe4d Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 12 Feb 2024 12:57:04 -0700 Subject: [PATCH 58/96] Use compare_digest when validateing hmac disgests --- changelog/66041.fixed.md | 1 + salt/modules/hashutil.py | 2 +- tests/pytests/unit/modules/test_hashutil.py | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 changelog/66041.fixed.md diff --git a/changelog/66041.fixed.md b/changelog/66041.fixed.md new file mode 100644 index 00000000000..7f099a8d8e1 --- /dev/null +++ b/changelog/66041.fixed.md @@ -0,0 +1 @@ +Use hmac compare_digest method in hashutil module to mitigate potential timing attacks diff --git a/salt/modules/hashutil.py b/salt/modules/hashutil.py index a4d1de17a63..926d385aa4f 100644 --- a/salt/modules/hashutil.py +++ b/salt/modules/hashutil.py @@ -294,4 +294,4 @@ def github_signature(string, shared_secret, challenge_hmac): if isinstance(key, str): key = salt.utils.stringutils.to_bytes(key) hmac_hash = hmac.new(key, msg, getattr(hashlib, hashtype)) - return hmac_hash.hexdigest() == challenge + return hmac.compare_digest(hmac_hash.hexdigest(), challenge) diff --git a/tests/pytests/unit/modules/test_hashutil.py b/tests/pytests/unit/modules/test_hashutil.py index c91e99ce6b7..57a237bad66 100644 --- a/tests/pytests/unit/modules/test_hashutil.py +++ b/tests/pytests/unit/modules/test_hashutil.py @@ -6,6 +6,7 @@ import pytest import salt.modules.hashutil as hashutil +from tests.support.mock import patch @pytest.fixture @@ -84,3 +85,9 @@ def test_hmac_compute(the_string, the_string_hmac_compute): def test_github_signature(the_string, the_string_github): assert hashutil.github_signature(the_string, "shared secret", the_string_github) + + +def test_github_signature_uses_hmac_compare_digest(the_string, the_string_github): + with patch("hmac.compare_digest") as hmac_compare: + assert hashutil.github_signature(the_string, "shared secret", the_string_github) + hmac_compare.assert_called_once() From 6a5a7fa9f3beb7c0779be31a2bde0eeeadd2d908 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 13 Feb 2024 15:07:34 -0700 Subject: [PATCH 59/96] Add persistant fileclient to renderes --- salt/loader/__init__.py | 16 ++++++++++++++-- salt/pillar/__init__.py | 14 ++++++++++---- salt/state.py | 3 ++- salt/utils/templates.py | 4 ++-- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/salt/loader/__init__.py b/salt/loader/__init__.py index f8feedfe727..88b82c4eb5b 100644 --- a/salt/loader/__init__.py +++ b/salt/loader/__init__.py @@ -534,6 +534,7 @@ def utils( whitelist=None, context=None, proxy=None, + file_client=None, pack_self=None, loaded_base_name=None, ): @@ -553,7 +554,11 @@ def utils( opts, tag="utils", whitelist=whitelist, - pack={"__context__": context, "__proxy__": proxy or {}}, + pack={ + "__context__": context, + "__proxy__": proxy or {}, + "__file_client__": file_client, + }, pack_self=pack_self, loaded_base_name=loaded_base_name, _only_pack_properly_namespaced_functions=False, @@ -908,7 +913,13 @@ def ssh_wrapper(opts, functions=None, context=None, loaded_base_name=None): def render( - opts, functions, states=None, proxy=None, context=None, loaded_base_name=None + opts, + functions, + states=None, + proxy=None, + context=None, + file_client=None, + loaded_base_name=None, ): """ Returns the render modules @@ -929,6 +940,7 @@ def render( "__salt__": functions, "__grains__": opts.get("grains", {}), "__context__": context, + "__file_client__": file_client, } if states: diff --git a/salt/pillar/__init__.py b/salt/pillar/__init__.py index d047f367fb5..9ad3c485fdf 100644 --- a/salt/pillar/__init__.py +++ b/salt/pillar/__init__.py @@ -570,17 +570,23 @@ class Pillar: # if we didn't pass in functions, lets load them if functions is None: - utils = salt.loader.utils(opts) + utils = salt.loader.utils(opts, file_client=self.client) if opts.get("file_client", "") == "local": - self.functions = salt.loader.minion_mods(opts, utils=utils) + self.functions = salt.loader.minion_mods( + opts, utils=utils, file_client=self.client + ) else: - self.functions = salt.loader.minion_mods(self.opts, utils=utils) + self.functions = salt.loader.minion_mods( + self.opts, utils=utils, file_client=self.client + ) else: self.functions = functions self.opts["minion_id"] = minion_id self.matchers = salt.loader.matchers(self.opts) - self.rend = salt.loader.render(self.opts, self.functions) + self.rend = salt.loader.render( + self.opts, self.functions, self.client, file_client=self.client + ) ext_pillar_opts = copy.deepcopy(self.opts) # Keep the incoming opts ID intact, ie, the master id if "id" in opts: diff --git a/salt/state.py b/salt/state.py index dfa64adae0e..2e00933c0a4 100644 --- a/salt/state.py +++ b/salt/state.py @@ -1295,7 +1295,7 @@ class State: Load the modules into the state """ log.info("Loading fresh modules for state activity") - self.utils = salt.loader.utils(self.opts) + self.utils = salt.loader.utils(self.opts, file_client=self.file_client) self.functions = salt.loader.minion_mods( self.opts, self.state_con, @@ -1327,6 +1327,7 @@ class State: self.functions, states=self.states, proxy=self.proxy, + file_client=self.file_client, context=self.state_con, ) diff --git a/salt/utils/templates.py b/salt/utils/templates.py index 4a8adf2a14f..554c76d51e1 100644 --- a/salt/utils/templates.py +++ b/salt/utils/templates.py @@ -27,6 +27,7 @@ import salt.utils.yamlencoding from salt import __path__ as saltpath from salt.exceptions import CommandExecutionError, SaltInvocationError, SaltRenderError from salt.loader.context import NamedLoaderContext +from salt.loader.dunder import __file_client__ from salt.utils.decorators.jinja import JinjaFilter, JinjaGlobal, JinjaTest from salt.utils.odict import OrderedDict from salt.utils.versions import Version @@ -351,7 +352,6 @@ def render_jinja_tmpl(tmplstr, context, tmplpath=None): saltenv = context["saltenv"] loader = None newline = False - file_client = context.get("fileclient", None) if tmplstr and not isinstance(tmplstr, str): # https://jinja.palletsprojects.com/en/2.11.x/api/#unicode @@ -371,7 +371,7 @@ def render_jinja_tmpl(tmplstr, context, tmplpath=None): opts, saltenv, pillar_rend=context.get("_pillar_rend", False), - _file_client=file_client, + _file_client=context.get("fileclient", __file_client__.value()), ) env_args = {"extensions": [], "loader": loader} From 1e90161d091fc803be5703a4b88172c935cd41b7 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 14 Feb 2024 00:42:10 -0700 Subject: [PATCH 60/96] Add tests to validate fileclient re-use --- .../functional/test_fileclient_reuse.py | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 tests/pytests/functional/test_fileclient_reuse.py diff --git a/tests/pytests/functional/test_fileclient_reuse.py b/tests/pytests/functional/test_fileclient_reuse.py new file mode 100644 index 00000000000..f4d6d0470ec --- /dev/null +++ b/tests/pytests/functional/test_fileclient_reuse.py @@ -0,0 +1,113 @@ +import pytest + +import salt.loader +import salt.pillar +import salt.state +import salt.utils.cache +from tests.support.mock import patch + + +@pytest.fixture +def mock_cached_loader(): + """ + Mock the SaltCacheLoader + + The mock keeps track of the number of + instantiations and the most recent args and kwargs. + """ + + class CacheLoader(salt.utils.jinja.SaltCacheLoader): + args = [] + kwargs = {} + calls = 0 + + def __init__(self, *args, **kwargs): + self.__class__.calls += 1 + self.__class__.args = args + self.__class__.kwargs = kwargs + super().__init__(*args, **kwargs) + + with patch("salt.utils.jinja.SaltCacheLoader", CacheLoader): + yield CacheLoader + + +def test_pillar_tops(temp_salt_master, temp_salt_minion, tmp_path, mock_cached_loader): + """ + pillar fileclient is used while rendering pillar tops + """ + tops = """ + base: + "*": + - test_pillar + """ + pillarsls = """ + foo: bar + """ + opts = temp_salt_master.config.copy() + + with temp_salt_master.pillar_tree.base.temp_file("top.sls", tops): + with temp_salt_master.pillar_tree.base.temp_file("test_pillar.sls", pillarsls): + grains = salt.loader.grains(opts) + pillar = salt.pillar.Pillar( + opts, + grains, + temp_salt_minion.id, + "base", + ) + pillar.get_tops() + assert mock_cached_loader.calls == 1 + assert "_file_client" in mock_cached_loader.kwargs + assert mock_cached_loader.kwargs["_file_client"] == pillar.client + + +def test_pillar_render( + temp_salt_master, temp_salt_minion, tmp_path, mock_cached_loader +): + """ + pillar fileclient is used while rendering jinja pillar + """ + tops = """ + base: + "*": + - test_pillar + """ + pillarsls = """ + foo: bar + """ + opts = temp_salt_master.config.copy() + + with temp_salt_master.pillar_tree.base.temp_file("top.sls", tops): + with temp_salt_master.pillar_tree.base.temp_file("test_pillar.sls", pillarsls): + grains = salt.loader.grains(opts) + pillar = salt.pillar.Pillar( + opts, + grains, + temp_salt_minion.id, + "base", + ) + pdata = pillar.render_pillar({"base": ["test_pillar"]}) + assert pdata == ({"foo": "bar"}, []) + assert mock_cached_loader.calls == 1 + assert "_file_client" in mock_cached_loader.kwargs + assert mock_cached_loader.kwargs["_file_client"] == pillar.client + + +def test_highstate(temp_salt_master, temp_salt_minion, tmp_path, mock_cached_loader): + """ + pillar fileclient is used while rendering pillar tops + """ + statesls = """ + test_state: + cmd.run: + - name: echos foo + """ + opts = temp_salt_master.config.copy() + + with temp_salt_master.state_tree.base.temp_file("test_state.sls", statesls): + highstate = salt.state.HighState( + opts, + ) + a = highstate.render_highstate({"base": ["test_state"]}) + assert mock_cached_loader.calls == 1 + assert "_file_client" in mock_cached_loader.kwargs + assert mock_cached_loader.kwargs["_file_client"] == highstate.client From a48355cf8b4c7ca2e48e4889641f9b0292f0e790 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 14 Feb 2024 00:44:27 -0700 Subject: [PATCH 61/96] Add changelog for fileclient re-use --- changelog/65450.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/65450.fixed.md diff --git a/changelog/65450.fixed.md b/changelog/65450.fixed.md new file mode 100644 index 00000000000..5847b07145c --- /dev/null +++ b/changelog/65450.fixed.md @@ -0,0 +1 @@ +Fix regression of fileclient re-use when rendering sls pillars and states From aaec5957bb5311e8200de69e91c90762c4bbf9d6 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 14 Feb 2024 14:19:33 -0700 Subject: [PATCH 62/96] Fix circular imports in tests --- salt/loader/__init__.py | 3 ++- salt/loader/dunder.py | 2 +- salt/payload.py | 1 - salt/utils/crypt.py | 5 ++++- tests/pytests/functional/test_fileclient_reuse.py | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/salt/loader/__init__.py b/salt/loader/__init__.py index 88b82c4eb5b..f2e6d1529df 100644 --- a/salt/loader/__init__.py +++ b/salt/loader/__init__.py @@ -20,7 +20,6 @@ import salt.syspaths import salt.utils.context import salt.utils.data import salt.utils.dictupdate -import salt.utils.event import salt.utils.files import salt.utils.lazy import salt.utils.odict @@ -358,6 +357,8 @@ def minion_mods( ret[f_key] = funcs[func] if notify: + import salt.utils.event + with salt.utils.event.get_event("minion", opts=opts, listen=False) as evt: evt.fire_event( {"complete": True}, tag=salt.defaults.events.MINION_MOD_REFRESH_COMPLETE diff --git a/salt/loader/dunder.py b/salt/loader/dunder.py index 5fae9014797..f0235d19a29 100644 --- a/salt/loader/dunder.py +++ b/salt/loader/dunder.py @@ -6,4 +6,4 @@ import salt.loader.context loader_context = salt.loader.context.LoaderContext() -__file_client__ = loader_context.named_context("__file_client__") +__file_client__ = loader_context.named_context("__file_client__", default=None) diff --git a/salt/payload.py b/salt/payload.py index 790e4cf2f6f..ab5ce6a05e3 100644 --- a/salt/payload.py +++ b/salt/payload.py @@ -9,7 +9,6 @@ import datetime import gc import logging -import salt.loader.context import salt.transport.frame import salt.utils.immutabletypes as immutabletypes import salt.utils.msgpack diff --git a/salt/utils/crypt.py b/salt/utils/crypt.py index b89a477a380..3f9c5955915 100644 --- a/salt/utils/crypt.py +++ b/salt/utils/crypt.py @@ -5,7 +5,6 @@ import hashlib import logging import os -import salt.loader import salt.utils.files from salt.exceptions import SaltInvocationError @@ -104,6 +103,10 @@ def decrypt( if renderers is None: if opts is None: raise TypeError("opts are required") + + # Avaoid circular import + import salt.loader + renderers = salt.loader.render(opts, {}) rend_func = renderers.get(rend) diff --git a/tests/pytests/functional/test_fileclient_reuse.py b/tests/pytests/functional/test_fileclient_reuse.py index f4d6d0470ec..87f6f706663 100644 --- a/tests/pytests/functional/test_fileclient_reuse.py +++ b/tests/pytests/functional/test_fileclient_reuse.py @@ -4,6 +4,7 @@ import salt.loader import salt.pillar import salt.state import salt.utils.cache +import salt.utils.jinja from tests.support.mock import patch From 17dddc83bab05b1d4d3026e8e1d51b3862ab99a9 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 15 Feb 2024 22:20:29 +0000 Subject: [PATCH 63/96] Increase timeouts on problematic tests --- tests/conftest.py | 2 +- tests/pytests/integration/cli/test_salt_deltaproxy.py | 2 -- tests/pytests/unit/cloud/test_cloud.py | 4 ++++ tests/unit/utils/test_process.py | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 598d492b706..f0c24f43d1b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -473,7 +473,7 @@ def pytest_collection_modifyitems(config, items): ): # Let's apply the timeout marker on the test, if the marker # is not already applied - item.add_marker(pytest.mark.timeout(60)) + item.add_marker(pytest.mark.timeout(90)) for fixture in item.fixturenames: if fixture not in item._fixtureinfo.name2fixturedefs: continue diff --git a/tests/pytests/integration/cli/test_salt_deltaproxy.py b/tests/pytests/integration/cli/test_salt_deltaproxy.py index b1b65b3cacb..a765164c95d 100644 --- a/tests/pytests/integration/cli/test_salt_deltaproxy.py +++ b/tests/pytests/integration/cli/test_salt_deltaproxy.py @@ -581,7 +581,6 @@ def ping(): [True, False], ids=["parallel_startup=True", "parallel_startup=False"], ) -@pytest.mark.timeout_unless_on_windows(120) def test_custom_proxy_module_raise_exception( salt_master, salt_cli, @@ -712,7 +711,6 @@ def ping(): # Hangs on Windows. You can add a timeout to the proxy.run command, but then # it just times out. @pytest.mark.skip_on_windows(reason=PRE_PYTEST_SKIP_REASON) -@pytest.mark.timeout_unless_on_windows(180) @pytest.mark.parametrize( "parallel_startup", [True, False], diff --git a/tests/pytests/unit/cloud/test_cloud.py b/tests/pytests/unit/cloud/test_cloud.py index ecdab4de575..c84f4ac1a0b 100644 --- a/tests/pytests/unit/cloud/test_cloud.py +++ b/tests/pytests/unit/cloud/test_cloud.py @@ -4,6 +4,10 @@ from salt.cloud import Cloud from salt.exceptions import SaltCloudSystemExit from tests.support.mock import MagicMock, patch +pytestmark = [ + pytest.mark.timeout_unless_on_windows(120), +] + @pytest.fixture def master_config(master_opts): diff --git a/tests/unit/utils/test_process.py b/tests/unit/utils/test_process.py index bc24e247638..f39d44add7a 100644 --- a/tests/unit/utils/test_process.py +++ b/tests/unit/utils/test_process.py @@ -26,6 +26,10 @@ except ImportError: log = logging.getLogger(__name__) +pytestmark = [ + pytest.mark.timeout_unless_on_windows(120), +] + def die(func): """ From 76a86f765d9c78d55fd188c20631a4c118ed9b85 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 16 Feb 2024 07:22:49 +0000 Subject: [PATCH 64/96] Run `pyupgrade` against the files modified in the merge-forward --- salt/modules/hashutil.py | 6 ++---- salt/utils/crypt.py | 6 ++---- tests/unit/utils/test_process.py | 6 +++--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/salt/modules/hashutil.py b/salt/modules/hashutil.py index 926d385aa4f..9e834794e4e 100644 --- a/salt/modules/hashutil.py +++ b/salt/modules/hashutil.py @@ -39,7 +39,7 @@ def digest(instr, checksum="md5"): if hash_func is None: raise salt.exceptions.CommandExecutionError( - "Hash func '{}' is not supported.".format(checksum) + f"Hash func '{checksum}' is not supported." ) return hash_func(instr) @@ -63,9 +63,7 @@ def digest_file(infile, checksum="md5"): salt '*' hashutil.digest_file /path/to/file """ if not __salt__["file.file_exists"](infile): - raise salt.exceptions.CommandExecutionError( - "File path '{}' not found.".format(infile) - ) + raise salt.exceptions.CommandExecutionError(f"File path '{infile}' not found.") with salt.utils.files.fopen(infile, "rb") as f: file_hash = __salt__["hashutil.digest"](f.read(), checksum) diff --git a/salt/utils/crypt.py b/salt/utils/crypt.py index 3f9c5955915..e34576c175a 100644 --- a/salt/utils/crypt.py +++ b/salt/utils/crypt.py @@ -111,9 +111,7 @@ def decrypt( rend_func = renderers.get(rend) if rend_func is None: - raise SaltInvocationError( - "Decryption renderer '{}' is not available".format(rend) - ) + raise SaltInvocationError(f"Decryption renderer '{rend}' is not available") return rend_func(data, translate_newlines=translate_newlines) @@ -159,7 +157,7 @@ def pem_finger(path=None, key=None, sum_type="sha256"): for ind, _ in enumerate(pre): if ind % 2: # Is odd - finger += "{}:".format(pre[ind]) + finger += f"{pre[ind]}:" else: finger += pre[ind] return finger.rstrip(":") diff --git a/tests/unit/utils/test_process.py b/tests/unit/utils/test_process.py index f39d44add7a..2d7f7634d8b 100644 --- a/tests/unit/utils/test_process.py +++ b/tests/unit/utils/test_process.py @@ -42,7 +42,7 @@ def die(func): name = func.__name__[5:] def _die(): - salt.utils.process.appendproctitle("test_{}".format(name)) + salt.utils.process.appendproctitle(f"test_{name}") attrname = "die_" + name setattr(self, attrname, _die) @@ -62,7 +62,7 @@ def incr(func): name = func.__name__[5:] def _incr(counter, num): - salt.utils.process.appendproctitle("test_{}".format(name)) + salt.utils.process.appendproctitle(f"test_{name}") for _ in range(0, num): counter.value += 1 @@ -84,7 +84,7 @@ def spin(func): name = func.__name__[5:] def _spin(): - salt.utils.process.appendproctitle("test_{}".format(name)) + salt.utils.process.appendproctitle(f"test_{name}") while True: time.sleep(1) From 17140c44b8730141a818cff3c3bd14a597de55c2 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Fri, 16 Feb 2024 00:48:30 -0700 Subject: [PATCH 65/96] Update deltaproxy test timeout --- .../integration/cli/test_salt_deltaproxy.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/pytests/integration/cli/test_salt_deltaproxy.py b/tests/pytests/integration/cli/test_salt_deltaproxy.py index a765164c95d..99c8368b73d 100644 --- a/tests/pytests/integration/cli/test_salt_deltaproxy.py +++ b/tests/pytests/integration/cli/test_salt_deltaproxy.py @@ -19,7 +19,7 @@ pytestmark = [ reason="Deltaproxy minions do not currently work on spawning platforms.", ), pytest.mark.core_test, - pytest.mark.timeout_unless_on_windows(320), + pytest.mark.timeout_unless_on_windows(400), ] @@ -182,7 +182,7 @@ def test_exit_status_correct_usage( proxy_minion_id, defaults=config_defaults, extra_cli_arguments_after_first_start_failure=["--log-level=info"], - start_timeout=240, + start_timeout=320, ) for minion_id in (proxy_minion_id, proxy_one, proxy_two): @@ -285,7 +285,7 @@ def test_missing_pillar_file( proxy_minion_id, defaults=config_defaults, extra_cli_arguments_after_first_start_failure=["--log-level=info"], - start_timeout=240, + start_timeout=320, ) for minion_id in (proxy_minion_id, proxy_one, proxy_two): @@ -409,7 +409,7 @@ def test_invalid_connection( proxy_minion_id, defaults=config_defaults, extra_cli_arguments_after_first_start_failure=["--log-level=info"], - start_timeout=240, + start_timeout=320, ) for minion_id in ( @@ -538,7 +538,7 @@ def ping(): proxy_minion_id, defaults=config_defaults, extra_cli_arguments_after_first_start_failure=["--log-level=info"], - start_timeout=240, + start_timeout=320, ) for minion_id in (proxy_minion_id, proxy_one, proxy_two): @@ -671,7 +671,7 @@ def ping(): proxy_minion_id, defaults=config_defaults, extra_cli_arguments_after_first_start_failure=["--log-level=info"], - start_timeout=240, + start_timeout=320, ) for minion_id in (proxy_minion_id, proxy_one, proxy_two): @@ -812,7 +812,7 @@ def test_exit_status_correct_usage_large_number_of_minions( proxy_minion_id, defaults=config_defaults, extra_cli_arguments_after_first_start_failure=["--log-level=info"], - start_timeout=240, + start_timeout=320, ) for minion_id in [proxy_minion_id] + sub_proxies: From 1ad68fcd93cdf458ac6a76e45fc6b980a8584afa Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 16 Feb 2024 17:02:51 +0000 Subject: [PATCH 66/96] Increase timeouts on problematic tests and default to `func_only=True` --- tests/conftest.py | 13 +++++++++---- tests/integration/ssh/test_state.py | 1 - tests/pytests/functional/loader/test_loader.py | 2 +- tests/pytests/functional/states/test_pkg.py | 2 +- tests/pytests/integration/cli/test_syndic_eauth.py | 2 +- .../pytests/integration/daemons/test_memory_leak.py | 1 + tests/pytests/integration/modules/test_virt.py | 2 +- tests/pytests/integration/netapi/test_ssh_client.py | 2 +- tests/pytests/integration/states/test_beacon.py | 2 +- 9 files changed, 16 insertions(+), 11 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index f0c24f43d1b..5f79f67e8d6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -460,9 +460,12 @@ def pytest_collection_modifyitems(config, items): if marker is not None: if not salt.utils.platform.is_windows(): # Apply the marker since we're not on windows - item.add_marker( - pytest.mark.timeout(*marker.args, **marker.kwargs.copy()) - ) + marker_kwargs = marker.kwargs.copy() + if "func_only" not in marker_kwargs: + # Default to counting only the test execution for the timeouts, ie, + # withough including the fixtures setup time towards the timeout. + marker_kwargs["func_only"] = True + item.add_marker(pytest.mark.timeout(*marker.args, **marker_kwargs)) else: if ( not salt.utils.platform.is_windows() @@ -473,7 +476,9 @@ def pytest_collection_modifyitems(config, items): ): # Let's apply the timeout marker on the test, if the marker # is not already applied - item.add_marker(pytest.mark.timeout(90)) + # Default to counting only the test execution for the timeouts, ie, + # withough including the fixtures setup time towards the timeout. + item.add_marker(pytest.mark.timeout(90, func_only=True)) for fixture in item.fixturenames: if fixture not in item._fixtureinfo.name2fixturedefs: continue diff --git a/tests/integration/ssh/test_state.py b/tests/integration/ssh/test_state.py index 3951358b9e2..e5dcd3053b5 100644 --- a/tests/integration/ssh/test_state.py +++ b/tests/integration/ssh/test_state.py @@ -56,7 +56,6 @@ class SSHStateTest(SSHCase): self.assertTrue(check_file) @pytest.mark.slow_test - @pytest.mark.timeout_unless_on_windows(120) def test_state_sls_id(self): """ test state.sls_id with salt-ssh diff --git a/tests/pytests/functional/loader/test_loader.py b/tests/pytests/functional/loader/test_loader.py index 00c16708e8f..f34ca2239cf 100644 --- a/tests/pytests/functional/loader/test_loader.py +++ b/tests/pytests/functional/loader/test_loader.py @@ -9,7 +9,7 @@ from tests.support.pytest.helpers import FakeSaltExtension pytestmark = [ # These are slow because they create a virtualenv and install salt in it pytest.mark.slow_test, - pytest.mark.timeout_unless_on_windows(120), + pytest.mark.timeout_unless_on_windows(240), ] diff --git a/tests/pytests/functional/states/test_pkg.py b/tests/pytests/functional/states/test_pkg.py index 746b25f4502..9ea9aa98aa1 100644 --- a/tests/pytests/functional/states/test_pkg.py +++ b/tests/pytests/functional/states/test_pkg.py @@ -19,7 +19,7 @@ pytestmark = [ pytest.mark.slow_test, pytest.mark.skip_if_not_root, pytest.mark.destructive_test, - pytest.mark.timeout_unless_on_windows(120), + pytest.mark.timeout_unless_on_windows(240), ] diff --git a/tests/pytests/integration/cli/test_syndic_eauth.py b/tests/pytests/integration/cli/test_syndic_eauth.py index 07908629683..a37127c3949 100644 --- a/tests/pytests/integration/cli/test_syndic_eauth.py +++ b/tests/pytests/integration/cli/test_syndic_eauth.py @@ -12,7 +12,7 @@ log = logging.getLogger(__name__) pytestmark = [ pytest.mark.core_test, - pytest.mark.timeout_unless_on_windows(600, func_only=True), + pytest.mark.timeout_unless_on_windows(600), ] diff --git a/tests/pytests/integration/daemons/test_memory_leak.py b/tests/pytests/integration/daemons/test_memory_leak.py index fb608fc1864..a81c69c150b 100644 --- a/tests/pytests/integration/daemons/test_memory_leak.py +++ b/tests/pytests/integration/daemons/test_memory_leak.py @@ -6,6 +6,7 @@ import pytest pytestmark = [ pytest.mark.slow_test, + pytest.mark.timeout_unless_on_windows(240), ] diff --git a/tests/pytests/integration/modules/test_virt.py b/tests/pytests/integration/modules/test_virt.py index fbb9c3d0a99..c3be6417d05 100644 --- a/tests/pytests/integration/modules/test_virt.py +++ b/tests/pytests/integration/modules/test_virt.py @@ -15,7 +15,7 @@ log = logging.getLogger(__name__) pytestmark = [ pytest.mark.slow_test, - pytest.mark.timeout_unless_on_windows(120, func_only=True), + pytest.mark.timeout_unless_on_windows(120), pytest.mark.skip_if_binaries_missing("docker"), ] diff --git a/tests/pytests/integration/netapi/test_ssh_client.py b/tests/pytests/integration/netapi/test_ssh_client.py index 20eb789b8f3..77c662fdea3 100644 --- a/tests/pytests/integration/netapi/test_ssh_client.py +++ b/tests/pytests/integration/netapi/test_ssh_client.py @@ -135,7 +135,7 @@ def test_ssh_disabled(client, auth_creds): assert ret is None -@pytest.mark.timeout_unless_on_windows(360, func_only=True) +@pytest.mark.timeout_unless_on_windows(360) def test_shell_inject_ssh_priv( client, salt_ssh_roster_file, rosters_dir, tmp_path, salt_auto_account, grains ): diff --git a/tests/pytests/integration/states/test_beacon.py b/tests/pytests/integration/states/test_beacon.py index d84d962f18f..5d6737e6a18 100644 --- a/tests/pytests/integration/states/test_beacon.py +++ b/tests/pytests/integration/states/test_beacon.py @@ -9,7 +9,7 @@ log = logging.getLogger(__name__) @pytest.mark.slow_test -@pytest.mark.timeout_unless_on_windows(120) +@pytest.mark.timeout_unless_on_windows(240) def test_present_absent(salt_master, salt_minion, salt_call_cli): ret = salt_call_cli.run("beacons.reset") From a974d5d7db907b4573f43de375c7f876cf99d014 Mon Sep 17 00:00:00 2001 From: Cian Yong Leow Date: Tue, 6 Feb 2024 17:47:48 +0000 Subject: [PATCH 67/96] Fix exceptions being set on completed futures Fixes an issue in the ZeroMQ transport where caught exceptions were being set on futures that had already completed (i.e. done) and were logging lots of error messages. --- changelog/66006.fixed.md | 1 + salt/transport/zeromq.py | 6 ++-- tests/pytests/unit/transport/test_zeromq.py | 36 ++++++++++++++++++++- 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 changelog/66006.fixed.md diff --git a/changelog/66006.fixed.md b/changelog/66006.fixed.md new file mode 100644 index 00000000000..ca7906d76f7 --- /dev/null +++ b/changelog/66006.fixed.md @@ -0,0 +1 @@ +Fix exceptions being set on futures that are already done in ZeroMQ transport \ No newline at end of file diff --git a/salt/transport/zeromq.py b/salt/transport/zeromq.py index 5b006b88592..96f12a0d6f7 100644 --- a/salt/transport/zeromq.py +++ b/salt/transport/zeromq.py @@ -607,14 +607,16 @@ class AsyncReqMessageClient: try: recv = yield self.socket.recv() except zmq.eventloop.future.CancelledError as exc: - future.set_exception(exc) + if not future.done(): + future.set_exception(exc) return if not future.done(): data = salt.payload.loads(recv) future.set_result(data) except Exception as exc: # pylint: disable=broad-except - future.set_exception(exc) + if not future.done(): + future.set_exception(exc) class ZeroMQSocketMonitor: diff --git a/tests/pytests/unit/transport/test_zeromq.py b/tests/pytests/unit/transport/test_zeromq.py index c5d5242319f..97d65a204ad 100644 --- a/tests/pytests/unit/transport/test_zeromq.py +++ b/tests/pytests/unit/transport/test_zeromq.py @@ -13,6 +13,7 @@ import uuid import msgpack import pytest +import zmq.eventloop.future import salt.channel.client import salt.channel.server @@ -27,7 +28,7 @@ import salt.utils.platform import salt.utils.process import salt.utils.stringutils from salt.master import SMaster -from tests.support.mock import MagicMock, patch +from tests.support.mock import AsyncMock, MagicMock, patch try: from M2Crypto import RSA @@ -1489,6 +1490,39 @@ async def test_client_timeout_msg(minion_opts): client.close() +async def test_client_send_recv_on_cancelled_error(minion_opts): + client = salt.transport.zeromq.AsyncReqMessageClient( + minion_opts, "tcp://127.0.0.1:4506" + ) + + mock_future = MagicMock(**{"done.return_value": True}) + + try: + client.socket = AsyncMock() + client.socket.recv.side_effect = zmq.eventloop.future.CancelledError + await client._send_recv({"meh": "bah"}, mock_future) + + mock_future.set_exception.assert_not_called() + finally: + client.close() + + +async def test_client_send_recv_on_exception(minion_opts): + client = salt.transport.zeromq.AsyncReqMessageClient( + minion_opts, "tcp://127.0.0.1:4506" + ) + + mock_future = MagicMock(**{"done.return_value": True}) + + try: + client.socket = None + await client._send_recv({"meh": "bah"}, mock_future) + + mock_future.set_exception.assert_not_called() + finally: + client.close() + + def test_pub_client_init(minion_opts, io_loop): minion_opts["id"] = "minion" minion_opts["__role"] = "syndic" From ed67c89403c14e5b9799a49a0543e2f0fe2950e8 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Thu, 15 Feb 2024 14:53:19 -0700 Subject: [PATCH 68/96] Fix pre-commit --- changelog/66006.fixed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/66006.fixed.md b/changelog/66006.fixed.md index ca7906d76f7..aa05c9c19af 100644 --- a/changelog/66006.fixed.md +++ b/changelog/66006.fixed.md @@ -1 +1 @@ -Fix exceptions being set on futures that are already done in ZeroMQ transport \ No newline at end of file +Fix exceptions being set on futures that are already done in ZeroMQ transport From c3826c61433ab784d7387eb7f1ed2262599dcb3e Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 17 Feb 2024 11:46:46 +0000 Subject: [PATCH 69/96] Increase timeouts on problematic test --- .../integration/daemons/test_memory_leak.py | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/tests/pytests/integration/daemons/test_memory_leak.py b/tests/pytests/integration/daemons/test_memory_leak.py index a81c69c150b..d61bb85b736 100644 --- a/tests/pytests/integration/daemons/test_memory_leak.py +++ b/tests/pytests/integration/daemons/test_memory_leak.py @@ -6,19 +6,15 @@ import pytest pytestmark = [ pytest.mark.slow_test, - pytest.mark.timeout_unless_on_windows(240), + pytest.mark.timeout_unless_on_windows(360), ] @pytest.fixture -def testfile_path(tmp_path): - return tmp_path / "testfile" - - -@pytest.fixture -def file_add_delete_sls(testfile_path, base_env_state_tree_root_dir): +def file_add_delete_sls(tmp_path, salt_master): + path = tmp_path / "testfile" sls_name = "file_add" - sls_contents = """ + sls_contents = f""" add_file: file.managed: - name: {path} @@ -36,16 +32,13 @@ def file_add_delete_sls(testfile_path, base_env_state_tree_root_dir): echo: cmd.run: - name: \"echo 'This is a test!'\" - """.format( - path=testfile_path - ) - with pytest.helpers.temp_file( - "{}.sls".format(sls_name), sls_contents, base_env_state_tree_root_dir - ): + """ + with salt_master.state_tree.base.temp_file(f"{sls_name}.sls", sls_contents): yield sls_name @pytest.mark.skip_on_fips_enabled_platform +@pytest.mark.skip_on_windows(reason="Windows is a spawning platform, won't work") @pytest.mark.skip_on_darwin(reason="MacOS is a spawning platform, won't work") @pytest.mark.flaky(max_runs=4) def test_memory_leak(salt_cli, salt_minion, file_add_delete_sls): From efa63ac3f2f8b46e1f61cb8bef0c7766664602d9 Mon Sep 17 00:00:00 2001 From: vzhestkov Date: Wed, 7 Feb 2024 14:09:49 +0100 Subject: [PATCH 70/96] Call set_lowest_log_level_by_opts with set_logging_options_dict --- salt/_logging/impl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/salt/_logging/impl.py b/salt/_logging/impl.py index cc18f49a9e9..2bcc27a0761 100644 --- a/salt/_logging/impl.py +++ b/salt/_logging/impl.py @@ -413,6 +413,7 @@ def set_logging_options_dict(opts): except AttributeError: pass set_logging_options_dict.__options_dict__ = opts + set_lowest_log_level_by_opts(opts) def freeze_logging_options_dict(): From 39bb721d3763e6c61b6c6a47f39462b6ad765f38 Mon Sep 17 00:00:00 2001 From: vzhestkov Date: Wed, 7 Feb 2024 15:36:00 +0100 Subject: [PATCH 71/96] Fix the _logging test with setting minimum logging level --- tests/pytests/integration/_logging/test_logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytests/integration/_logging/test_logging.py b/tests/pytests/integration/_logging/test_logging.py index a0fa779308b..8e38f55b38d 100644 --- a/tests/pytests/integration/_logging/test_logging.py +++ b/tests/pytests/integration/_logging/test_logging.py @@ -48,7 +48,7 @@ def log_nameToLevel(name): def test_lowest_log_level(): ret = log_impl.get_lowest_log_level() - assert ret is None + assert ret is not None log_impl.set_lowest_log_level(log_nameToLevel("DEBUG")) ret = log_impl.get_lowest_log_level() From 9cc0635ed3845a3528e43eff84748bf6f331aa01 Mon Sep 17 00:00:00 2001 From: vzhestkov Date: Thu, 8 Feb 2024 10:00:20 +0100 Subject: [PATCH 72/96] Fix test_deferred_stream_handler test --- .../_logging/handlers/test_deferred_stream_handler.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/pytests/unit/_logging/handlers/test_deferred_stream_handler.py b/tests/pytests/unit/_logging/handlers/test_deferred_stream_handler.py index 76b0e88eca5..62c0dff4be4 100644 --- a/tests/pytests/unit/_logging/handlers/test_deferred_stream_handler.py +++ b/tests/pytests/unit/_logging/handlers/test_deferred_stream_handler.py @@ -9,6 +9,7 @@ import pytest from pytestshellutils.utils.processes import terminate_process from salt._logging.handlers import DeferredStreamHandler +from salt._logging.impl import set_lowest_log_level from salt.utils.nb_popen import NonBlockingPopen from tests.support.helpers import CaptureOutput, dedent from tests.support.runtests import RUNTIME_VARS @@ -20,7 +21,7 @@ def _sync_with_handlers_proc_target(): with CaptureOutput() as stds: handler = DeferredStreamHandler(sys.stderr) - handler.setLevel(logging.DEBUG) + set_lowest_log_level(logging.DEBUG) formatter = logging.Formatter("%(message)s") handler.setFormatter(formatter) logging.root.addHandler(handler) @@ -45,7 +46,7 @@ def _deferred_write_on_flush_proc_target(): with CaptureOutput() as stds: handler = DeferredStreamHandler(sys.stderr) - handler.setLevel(logging.DEBUG) + set_lowest_log_level(logging.DEBUG) formatter = logging.Formatter("%(message)s") handler.setFormatter(formatter) logging.root.addHandler(handler) @@ -126,7 +127,7 @@ def test_deferred_write_on_atexit(tmp_path): # Just loop consuming output while True: if time.time() > max_time: - pytest.fail("Script didn't exit after {} second".format(execution_time)) + pytest.fail(f"Script didn't exit after {execution_time} second") time.sleep(0.125) _out = proc.recv() @@ -146,7 +147,7 @@ def test_deferred_write_on_atexit(tmp_path): finally: terminate_process(proc.pid, kill_children=True) if b"Foo" not in err: - pytest.fail("'Foo' should be in stderr and it's not: {}".format(err)) + pytest.fail(f"'Foo' should be in stderr and it's not: {err}") @pytest.mark.skip_on_windows(reason="Windows does not support SIGINT") From 729cf37b79aac731a97a60346b035f6e67786817 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sat, 17 Feb 2024 15:32:49 -0700 Subject: [PATCH 73/96] Set loglevel for unit test --- .../unit/modules/win_lgpo/test_adv_audit.py | 19 ++++++++++++------- .../unit/modules/win_lgpo/test_secedit.py | 16 ++++++++++------ .../pytests/unit/state/test_state_compiler.py | 9 +++++---- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/tests/pytests/unit/modules/win_lgpo/test_adv_audit.py b/tests/pytests/unit/modules/win_lgpo/test_adv_audit.py index 1f8e83eeab3..c982ff6abb0 100644 --- a/tests/pytests/unit/modules/win_lgpo/test_adv_audit.py +++ b/tests/pytests/unit/modules/win_lgpo/test_adv_audit.py @@ -1,3 +1,5 @@ +import logging + import pytest import salt.modules.win_file as win_file @@ -158,11 +160,14 @@ def test_set_value_log_messages(caplog): mock_set_file_data = MagicMock(return_value=True) mock_set_pol_data = MagicMock(return_value=False) mock_context = {"lgpo.adv_audit_data": {"test_option": "test_value"}} - with patch.object( - win_lgpo, "_set_advaudit_file_data", mock_set_file_data - ), patch.object(win_lgpo, "_set_advaudit_pol_data", mock_set_pol_data), patch.dict( - win_lgpo.__context__, mock_context - ): - win_lgpo._set_advaudit_value("test_option", None) - assert "Failed to apply audit setting:" in caplog.text + with caplog.at_level(logging.DEBUG): + with patch.object( + win_lgpo, "_set_advaudit_file_data", mock_set_file_data + ), patch.object( + win_lgpo, "_set_advaudit_pol_data", mock_set_pol_data + ), patch.dict( + win_lgpo.__context__, mock_context + ): + win_lgpo._set_advaudit_value("test_option", None) + assert "Failed to apply audit setting:" in caplog.text assert "LGPO: Removing Advanced Audit data:" in caplog.text diff --git a/tests/pytests/unit/modules/win_lgpo/test_secedit.py b/tests/pytests/unit/modules/win_lgpo/test_secedit.py index 47a39fb8250..3a5228f465d 100644 --- a/tests/pytests/unit/modules/win_lgpo/test_secedit.py +++ b/tests/pytests/unit/modules/win_lgpo/test_secedit.py @@ -1,3 +1,5 @@ +import logging + import pytest import salt.modules.cmdmod as cmd @@ -69,15 +71,17 @@ def test_write_secedit_data_import_fail(caplog): patch_cmd_retcode = patch.dict( win_lgpo.__salt__, {"cmd.retcode": MagicMock(return_value=1)} ) - with patch_cmd_retcode: - assert win_lgpo._write_secedit_data("spongebob") is False - assert "Secedit failed to import template data" in caplog.text + with caplog.at_level(logging.DEBUG): + with patch_cmd_retcode: + assert win_lgpo._write_secedit_data("spongebob") is False + assert "Secedit failed to import template data" in caplog.text def test_write_secedit_data_configure_fail(caplog): patch_cmd_retcode = patch.dict( win_lgpo.__salt__, {"cmd.retcode": MagicMock(side_effect=[0, 1])} ) - with patch_cmd_retcode: - assert win_lgpo._write_secedit_data("spongebob") is False - assert "Secedit failed to apply security database" in caplog.text + with caplog.at_level(logging.DEBUG): + with patch_cmd_retcode: + assert win_lgpo._write_secedit_data("spongebob") is False + assert "Secedit failed to apply security database" in caplog.text diff --git a/tests/pytests/unit/state/test_state_compiler.py b/tests/pytests/unit/state/test_state_compiler.py index 4aaf3b29236..db91a0109d7 100644 --- a/tests/pytests/unit/state/test_state_compiler.py +++ b/tests/pytests/unit/state/test_state_compiler.py @@ -42,10 +42,11 @@ def test_format_log_list(caplog): """ Test running format_log when ret is not a dictionary """ - ret = ["test1", "test2"] - salt.state.format_log(ret) - assert "INFO" in caplog.text - assert f"{ret}" in caplog.text + with caplog.at_level(logging.INFO): + ret = ["test1", "test2"] + salt.state.format_log(ret) + assert "INFO" in caplog.text + assert f"{ret}" in caplog.text def test_render_error_on_invalid_requisite(minion_opts): From 7c8a104f3f774a05884492f071f8f424fbe0d0e1 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 18 Feb 2024 19:41:49 +0000 Subject: [PATCH 74/96] Fix test failures --- tests/pytests/unit/test_minion.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/pytests/unit/test_minion.py b/tests/pytests/unit/test_minion.py index 160cb024986..9523a81a92f 100644 --- a/tests/pytests/unit/test_minion.py +++ b/tests/pytests/unit/test_minion.py @@ -1181,7 +1181,7 @@ async def test_connect_master_unresolveable_error(minion_opts, connect_master_mo connect_master_mock.exc = SaltMasterUnresolvableError minion.connect_master = connect_master_mock minion.destroy = MagicMock() - mm._connect_minion(minion) + await mm._connect_minion(minion) minion.destroy.assert_called_once() # Unresolvable errors break out of the loop. @@ -1194,10 +1194,10 @@ async def test_connect_master_general_exception_error(minion_opts, connect_maste """ mm = salt.minion.MinionManager(minion_opts) minion = salt.minion.Minion(minion_opts) - connect_master_mock.exc = Exception + connect_master_mock.exc = SaltClientError minion.connect_master = connect_master_mock minion.destroy = MagicMock() - mm._connect_minion(minion) + await mm._connect_minion(minion) minion.destroy.assert_called_once() # The first call raised an error which caused minion.destroy to get called, From 8721d4757803272f7709db9a9235b90045dc5997 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 18 Feb 2024 19:43:30 +0000 Subject: [PATCH 75/96] Increase timeouts in problematic tests --- tests/pytests/functional/cli/test_salt_deltaproxy.py | 1 + tests/unit/utils/test_pyobjects.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/tests/pytests/functional/cli/test_salt_deltaproxy.py b/tests/pytests/functional/cli/test_salt_deltaproxy.py index 429c4812457..022aa77efcf 100644 --- a/tests/pytests/functional/cli/test_salt_deltaproxy.py +++ b/tests/pytests/functional/cli/test_salt_deltaproxy.py @@ -19,6 +19,7 @@ pytestmark = [ reason="Deltaproxy minions do not currently work on spawning platforms.", ), pytest.mark.core_test, + pytest.mark.timeout_unless_on_windows(320), ] diff --git a/tests/unit/utils/test_pyobjects.py b/tests/unit/utils/test_pyobjects.py index 6a7bd406237..c36a98dab18 100644 --- a/tests/unit/utils/test_pyobjects.py +++ b/tests/unit/utils/test_pyobjects.py @@ -24,6 +24,10 @@ from salt.utils.pyobjects import ( from tests.support.runtests import RUNTIME_VARS from tests.support.unit import TestCase +pytestmark = [ + pytest.mark.timeout_unless_on_windows(120), +] + log = logging.getLogger(__name__) From 37cf95b17aa0d6de0348793646ffe4a05be4f515 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 18 Feb 2024 19:52:30 +0000 Subject: [PATCH 76/96] It's `tornado.gen.Return` not `salt.tornado.gen.Return` --- salt/channel/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/channel/client.py b/salt/channel/client.py index 6bf02d5275c..ea42cefaef0 100644 --- a/salt/channel/client.py +++ b/salt/channel/client.py @@ -619,7 +619,7 @@ class AsyncPubChannel: "Payload decryption failed even after re-authenticating with master %s", self.opts["master_ip"], ) - raise salt.tornado.gen.Return(payload) + raise tornado.gen.Return(payload) def __enter__(self): return self From bf02ba409a6b6c6b2f55765b2982374b63a6a806 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 18 Feb 2024 09:25:08 +0000 Subject: [PATCH 77/96] Bump to `cryptography==42.0.3` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f --- changelog/66090.security.md | 1 + requirements/static/ci/py3.10/cloud.txt | 2 +- requirements/static/ci/py3.10/darwin.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 2 +- requirements/static/ci/py3.10/lint.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 2 +- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.11/cloud.txt | 2 +- requirements/static/ci/py3.11/darwin.txt | 2 +- requirements/static/ci/py3.11/freebsd.txt | 2 +- requirements/static/ci/py3.11/lint.txt | 2 +- requirements/static/ci/py3.11/linux.txt | 2 +- requirements/static/ci/py3.11/windows.txt | 2 +- requirements/static/ci/py3.12/cloud.txt | 2 +- requirements/static/ci/py3.12/darwin.txt | 2 +- requirements/static/ci/py3.12/freebsd.txt | 2 +- requirements/static/ci/py3.12/lint.txt | 2 +- requirements/static/ci/py3.12/linux.txt | 2 +- requirements/static/ci/py3.12/windows.txt | 2 +- requirements/static/ci/py3.7/cloud.txt | 2 +- requirements/static/ci/py3.7/freebsd.txt | 2 +- requirements/static/ci/py3.7/lint.txt | 2 +- requirements/static/ci/py3.7/linux.txt | 2 +- requirements/static/ci/py3.7/windows.txt | 2 +- requirements/static/ci/py3.8/cloud.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.8/lint.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/cloud.txt | 2 +- requirements/static/ci/py3.9/darwin.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 2 +- requirements/static/ci/py3.9/lint.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- requirements/static/pkg/py3.10/darwin.txt | 2 +- requirements/static/pkg/py3.10/freebsd.txt | 2 +- requirements/static/pkg/py3.10/linux.txt | 2 +- requirements/static/pkg/py3.10/windows.txt | 2 +- requirements/static/pkg/py3.11/darwin.txt | 2 +- requirements/static/pkg/py3.11/freebsd.txt | 2 +- requirements/static/pkg/py3.11/linux.txt | 2 +- requirements/static/pkg/py3.11/windows.txt | 2 +- requirements/static/pkg/py3.12/darwin.txt | 2 +- requirements/static/pkg/py3.12/freebsd.txt | 2 +- requirements/static/pkg/py3.12/linux.txt | 2 +- requirements/static/pkg/py3.12/windows.txt | 2 +- requirements/static/pkg/py3.7/freebsd.txt | 2 +- requirements/static/pkg/py3.7/linux.txt | 2 +- requirements/static/pkg/py3.7/windows.txt | 2 +- requirements/static/pkg/py3.8/freebsd.txt | 2 +- requirements/static/pkg/py3.8/linux.txt | 2 +- requirements/static/pkg/py3.8/windows.txt | 2 +- requirements/static/pkg/py3.9/darwin.txt | 2 +- requirements/static/pkg/py3.9/freebsd.txt | 2 +- requirements/static/pkg/py3.9/linux.txt | 2 +- requirements/static/pkg/py3.9/windows.txt | 2 +- 57 files changed, 57 insertions(+), 56 deletions(-) create mode 100644 changelog/66090.security.md diff --git a/changelog/66090.security.md b/changelog/66090.security.md new file mode 100644 index 00000000000..2082ab1778f --- /dev/null +++ b/changelog/66090.security.md @@ -0,0 +1 @@ +Bump to `cryptography==42.0.3` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index 2e26f748b10..09d77fbf660 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -123,7 +123,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.10/linux.txt # -c requirements/static/ci/py3.10/linux.txt diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 0db7a73df32..4c26edc73f2 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -89,7 +89,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.10/darwin.txt # -r requirements/darwin.txt diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 624670cc487..85d2e70eb1e 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -86,7 +86,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.10/freebsd.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index d9efc924269..8939ed5560b 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -134,7 +134,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.10/linux.txt # -c requirements/static/ci/py3.10/linux.txt diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 747813365d1..0b7cd2bdafa 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -95,7 +95,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.10/linux.txt # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 0d436a86b00..1bfad4d3002 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -81,7 +81,7 @@ contextvars==2.4 # via # -c requirements/static/ci/../pkg/py3.10/windows.txt # -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.10/windows.txt # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.11/cloud.txt b/requirements/static/ci/py3.11/cloud.txt index 3538b833491..b22053c1d2b 100644 --- a/requirements/static/ci/py3.11/cloud.txt +++ b/requirements/static/ci/py3.11/cloud.txt @@ -119,7 +119,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.11/linux.txt # -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.11/linux.txt # -c requirements/static/ci/py3.11/linux.txt diff --git a/requirements/static/ci/py3.11/darwin.txt b/requirements/static/ci/py3.11/darwin.txt index ac2598aa27c..91b0c049738 100644 --- a/requirements/static/ci/py3.11/darwin.txt +++ b/requirements/static/ci/py3.11/darwin.txt @@ -85,7 +85,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.11/darwin.txt # -r requirements/darwin.txt diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index 3b0f08b5466..e824caf1b2e 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -84,7 +84,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.11/freebsd.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.11/lint.txt b/requirements/static/ci/py3.11/lint.txt index 809aaf42e34..39cb22c38b1 100644 --- a/requirements/static/ci/py3.11/lint.txt +++ b/requirements/static/ci/py3.11/lint.txt @@ -130,7 +130,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.11/linux.txt # -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.11/linux.txt # -c requirements/static/ci/py3.11/linux.txt diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index cbcbe0691f5..96ac6767567 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -93,7 +93,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.11/linux.txt # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index 9f36f069ed7..aedf67bc8aa 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -79,7 +79,7 @@ contextvars==2.4 # via # -c requirements/static/ci/../pkg/py3.11/windows.txt # -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.11/windows.txt # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.12/cloud.txt b/requirements/static/ci/py3.12/cloud.txt index baff0486737..6c6fdd33144 100644 --- a/requirements/static/ci/py3.12/cloud.txt +++ b/requirements/static/ci/py3.12/cloud.txt @@ -119,7 +119,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.12/linux.txt # -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt # -c requirements/static/ci/py3.12/linux.txt diff --git a/requirements/static/ci/py3.12/darwin.txt b/requirements/static/ci/py3.12/darwin.txt index 01e5031f84f..33d4948fd84 100644 --- a/requirements/static/ci/py3.12/darwin.txt +++ b/requirements/static/ci/py3.12/darwin.txt @@ -85,7 +85,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.12/darwin.txt # -r requirements/darwin.txt diff --git a/requirements/static/ci/py3.12/freebsd.txt b/requirements/static/ci/py3.12/freebsd.txt index e8ecd33041d..69ef14fa266 100644 --- a/requirements/static/ci/py3.12/freebsd.txt +++ b/requirements/static/ci/py3.12/freebsd.txt @@ -84,7 +84,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.12/freebsd.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.12/lint.txt b/requirements/static/ci/py3.12/lint.txt index 84a6d7531c2..a610443f6e6 100644 --- a/requirements/static/ci/py3.12/lint.txt +++ b/requirements/static/ci/py3.12/lint.txt @@ -130,7 +130,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.12/linux.txt # -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt # -c requirements/static/ci/py3.12/linux.txt diff --git a/requirements/static/ci/py3.12/linux.txt b/requirements/static/ci/py3.12/linux.txt index 3bc22ec845d..2791b36b16e 100644 --- a/requirements/static/ci/py3.12/linux.txt +++ b/requirements/static/ci/py3.12/linux.txt @@ -93,7 +93,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.12/windows.txt b/requirements/static/ci/py3.12/windows.txt index 123ef228b3e..d341675cc8c 100644 --- a/requirements/static/ci/py3.12/windows.txt +++ b/requirements/static/ci/py3.12/windows.txt @@ -79,7 +79,7 @@ contextvars==2.4 # via # -c requirements/static/ci/../pkg/py3.12/windows.txt # -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.12/windows.txt # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index ceb1ab28e59..447b9143d98 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -137,7 +137,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.7/linux.txt # -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.7/linux.txt # -c requirements/static/ci/py3.7/linux.txt diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 9e5fa6abe24..470d3916c44 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -96,7 +96,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.7/freebsd.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 1209d4fddec..bc9fea72e56 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -148,7 +148,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.7/linux.txt # -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.7/linux.txt # -c requirements/static/ci/py3.7/linux.txt diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index fa792be8479..883dd34afa6 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -103,7 +103,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.7/linux.txt # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index 48a3c7b88f5..4196d4dd67b 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -88,7 +88,7 @@ contextvars==2.4 # via # -c requirements/static/ci/../pkg/py3.7/windows.txt # -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.7/windows.txt # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 9446a0ab2fd..0d7f793b3eb 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -132,7 +132,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt # -c requirements/static/ci/py3.8/linux.txt diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index f08e563e759..b2451466a0c 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -91,7 +91,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.8/freebsd.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index f993a34467f..f230eca7800 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -139,7 +139,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt # -c requirements/static/ci/py3.8/linux.txt diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index a7ca864214f..c9aff251e83 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -98,7 +98,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index c6147de3cbd..0dc77cb40c8 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -83,7 +83,7 @@ contextvars==2.4 # via # -c requirements/static/ci/../pkg/py3.8/windows.txt # -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.8/windows.txt # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index 6a120948bf7..aa313eaeba0 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -132,7 +132,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.9/linux.txt # -c requirements/static/ci/py3.9/linux.txt diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 4b58947462e..b5f5433fd82 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -94,7 +94,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.9/darwin.txt # -r requirements/darwin.txt diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 1a0066b4969..51ca8c39796 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -91,7 +91,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.9/freebsd.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index befefe24901..eac557ef05f 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -135,7 +135,7 @@ croniter==0.3.29 ; sys_platform != "win32" # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.9/linux.txt # -c requirements/static/ci/py3.9/linux.txt diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index 96f3b02f5d1..d5fd78085fb 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -96,7 +96,7 @@ contextvars==2.4 # -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.9/linux.txt # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 924d376cc56..66cf7d68220 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -83,7 +83,7 @@ contextvars==2.4 # via # -c requirements/static/ci/../pkg/py3.9/windows.txt # -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -c requirements/static/ci/../pkg/py3.9/windows.txt # -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.10/darwin.txt b/requirements/static/pkg/py3.10/darwin.txt index ce0d3a58001..580aee71cea 100644 --- a/requirements/static/pkg/py3.10/darwin.txt +++ b/requirements/static/pkg/py3.10/darwin.txt @@ -18,7 +18,7 @@ cherrypy==18.6.1 # via -r requirements/darwin.txt contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/darwin.txt # pyopenssl diff --git a/requirements/static/pkg/py3.10/freebsd.txt b/requirements/static/pkg/py3.10/freebsd.txt index 38f1cee6c04..b8fb5adcfd0 100644 --- a/requirements/static/pkg/py3.10/freebsd.txt +++ b/requirements/static/pkg/py3.10/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/static/pkg/freebsd.in # pyopenssl diff --git a/requirements/static/pkg/py3.10/linux.txt b/requirements/static/pkg/py3.10/linux.txt index 3519c80d5c2..8fe756db97b 100644 --- a/requirements/static/pkg/py3.10/linux.txt +++ b/requirements/static/pkg/py3.10/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/static/pkg/linux.in # pyopenssl diff --git a/requirements/static/pkg/py3.10/windows.txt b/requirements/static/pkg/py3.10/windows.txt index 3e9577ad5ac..04a533df6ac 100644 --- a/requirements/static/pkg/py3.10/windows.txt +++ b/requirements/static/pkg/py3.10/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/windows.txt # pyopenssl diff --git a/requirements/static/pkg/py3.11/darwin.txt b/requirements/static/pkg/py3.11/darwin.txt index 8556418f08c..7115c10c033 100644 --- a/requirements/static/pkg/py3.11/darwin.txt +++ b/requirements/static/pkg/py3.11/darwin.txt @@ -18,7 +18,7 @@ cherrypy==18.6.1 # via -r requirements/darwin.txt contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/darwin.txt # pyopenssl diff --git a/requirements/static/pkg/py3.11/freebsd.txt b/requirements/static/pkg/py3.11/freebsd.txt index 0b7231fa1bc..4d0efd22b28 100644 --- a/requirements/static/pkg/py3.11/freebsd.txt +++ b/requirements/static/pkg/py3.11/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/static/pkg/freebsd.in # pyopenssl diff --git a/requirements/static/pkg/py3.11/linux.txt b/requirements/static/pkg/py3.11/linux.txt index 941a138d867..778444c5c36 100644 --- a/requirements/static/pkg/py3.11/linux.txt +++ b/requirements/static/pkg/py3.11/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/static/pkg/linux.in # pyopenssl diff --git a/requirements/static/pkg/py3.11/windows.txt b/requirements/static/pkg/py3.11/windows.txt index 4624a4e3c67..5c9f92282db 100644 --- a/requirements/static/pkg/py3.11/windows.txt +++ b/requirements/static/pkg/py3.11/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/windows.txt # pyopenssl diff --git a/requirements/static/pkg/py3.12/darwin.txt b/requirements/static/pkg/py3.12/darwin.txt index fdfa321dda5..e933c26b1c3 100644 --- a/requirements/static/pkg/py3.12/darwin.txt +++ b/requirements/static/pkg/py3.12/darwin.txt @@ -18,7 +18,7 @@ cherrypy==18.6.1 # via -r requirements/darwin.txt contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/darwin.txt # pyopenssl diff --git a/requirements/static/pkg/py3.12/freebsd.txt b/requirements/static/pkg/py3.12/freebsd.txt index 95dfcf9bd0d..b35a6ed7c60 100644 --- a/requirements/static/pkg/py3.12/freebsd.txt +++ b/requirements/static/pkg/py3.12/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/static/pkg/freebsd.in # pyopenssl diff --git a/requirements/static/pkg/py3.12/linux.txt b/requirements/static/pkg/py3.12/linux.txt index 9d60255b20b..36dad51c518 100644 --- a/requirements/static/pkg/py3.12/linux.txt +++ b/requirements/static/pkg/py3.12/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/static/pkg/linux.in # pyopenssl diff --git a/requirements/static/pkg/py3.12/windows.txt b/requirements/static/pkg/py3.12/windows.txt index ec5d62dc6f2..139e02646d9 100644 --- a/requirements/static/pkg/py3.12/windows.txt +++ b/requirements/static/pkg/py3.12/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.6 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/windows.txt # pyopenssl diff --git a/requirements/static/pkg/py3.7/freebsd.txt b/requirements/static/pkg/py3.7/freebsd.txt index 3e410b659fd..78f18baa058 100644 --- a/requirements/static/pkg/py3.7/freebsd.txt +++ b/requirements/static/pkg/py3.7/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/static/pkg/freebsd.in # pyopenssl diff --git a/requirements/static/pkg/py3.7/linux.txt b/requirements/static/pkg/py3.7/linux.txt index c362d04ac07..af9c95848c1 100644 --- a/requirements/static/pkg/py3.7/linux.txt +++ b/requirements/static/pkg/py3.7/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/static/pkg/linux.in # pyopenssl diff --git a/requirements/static/pkg/py3.7/windows.txt b/requirements/static/pkg/py3.7/windows.txt index cc5f5bddf7a..5dc5bd0c26e 100644 --- a/requirements/static/pkg/py3.7/windows.txt +++ b/requirements/static/pkg/py3.7/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/windows.txt # pyopenssl diff --git a/requirements/static/pkg/py3.8/freebsd.txt b/requirements/static/pkg/py3.8/freebsd.txt index d0206e14572..ca14d339d99 100644 --- a/requirements/static/pkg/py3.8/freebsd.txt +++ b/requirements/static/pkg/py3.8/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/static/pkg/freebsd.in # pyopenssl diff --git a/requirements/static/pkg/py3.8/linux.txt b/requirements/static/pkg/py3.8/linux.txt index 161fc6c7543..96f199423b3 100644 --- a/requirements/static/pkg/py3.8/linux.txt +++ b/requirements/static/pkg/py3.8/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/static/pkg/linux.in # pyopenssl diff --git a/requirements/static/pkg/py3.8/windows.txt b/requirements/static/pkg/py3.8/windows.txt index ec552593ed1..37cc395ca1e 100644 --- a/requirements/static/pkg/py3.8/windows.txt +++ b/requirements/static/pkg/py3.8/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/windows.txt # pyopenssl diff --git a/requirements/static/pkg/py3.9/darwin.txt b/requirements/static/pkg/py3.9/darwin.txt index 070233cc5c0..b69c8e5458f 100644 --- a/requirements/static/pkg/py3.9/darwin.txt +++ b/requirements/static/pkg/py3.9/darwin.txt @@ -18,7 +18,7 @@ cherrypy==18.6.1 # via -r requirements/darwin.txt contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/darwin.txt # pyopenssl diff --git a/requirements/static/pkg/py3.9/freebsd.txt b/requirements/static/pkg/py3.9/freebsd.txt index 26a72d973db..ec352b00707 100644 --- a/requirements/static/pkg/py3.9/freebsd.txt +++ b/requirements/static/pkg/py3.9/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/static/pkg/freebsd.in # pyopenssl diff --git a/requirements/static/pkg/py3.9/linux.txt b/requirements/static/pkg/py3.9/linux.txt index 61b55ecfd1d..168ff8d8798 100644 --- a/requirements/static/pkg/py3.9/linux.txt +++ b/requirements/static/pkg/py3.9/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/static/pkg/linux.in # pyopenssl diff --git a/requirements/static/pkg/py3.9/windows.txt b/requirements/static/pkg/py3.9/windows.txt index f434e2d766d..57de2e7ee0b 100644 --- a/requirements/static/pkg/py3.9/windows.txt +++ b/requirements/static/pkg/py3.9/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==42.0.0 +cryptography==42.0.3 # via # -r requirements/windows.txt # pyopenssl From f335d64b0c3f4af56607c6ecd884bd9e93fc7357 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 18 Feb 2024 09:34:13 +0000 Subject: [PATCH 78/96] Bump to ``ansible-core==2.16.3`` due to https://github.com/advisories/GHSA-h24r-m9qc-pvpg --- requirements/static/ci/py3.10/lint.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 2 +- requirements/static/ci/py3.11/lint.txt | 2 +- requirements/static/ci/py3.11/linux.txt | 2 +- requirements/static/ci/py3.12/lint.txt | 2 +- requirements/static/ci/py3.12/linux.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index 8939ed5560b..fbcaa9b1269 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -12,7 +12,7 @@ aiosignal==1.2.0 # via # -c requirements/static/ci/py3.10/linux.txt # aiohttp -ansible-core==2.16.2 +ansible-core==2.16.3 # via # -c requirements/static/ci/py3.10/linux.txt # ansible diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 0b7cd2bdafa..32e36df3589 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -8,7 +8,7 @@ aiohttp==3.9.2 # via etcd3-py aiosignal==1.2.0 # via aiohttp -ansible-core==2.16.2 +ansible-core==2.16.3 # via ansible ansible==9.1.0 ; python_version >= "3.10" # via -r requirements/static/ci/linux.in diff --git a/requirements/static/ci/py3.11/lint.txt b/requirements/static/ci/py3.11/lint.txt index 39cb22c38b1..e1b74f92032 100644 --- a/requirements/static/ci/py3.11/lint.txt +++ b/requirements/static/ci/py3.11/lint.txt @@ -12,7 +12,7 @@ aiosignal==1.2.0 # via # -c requirements/static/ci/py3.11/linux.txt # aiohttp -ansible-core==2.16.2 +ansible-core==2.16.3 # via # -c requirements/static/ci/py3.11/linux.txt # ansible diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index 96ac6767567..cf2f4fbf1c5 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -8,7 +8,7 @@ aiohttp==3.9.2 # via etcd3-py aiosignal==1.2.0 # via aiohttp -ansible-core==2.16.2 +ansible-core==2.16.3 # via ansible ansible==9.1.0 ; python_version >= "3.10" # via -r requirements/static/ci/linux.in diff --git a/requirements/static/ci/py3.12/lint.txt b/requirements/static/ci/py3.12/lint.txt index a610443f6e6..777079138cc 100644 --- a/requirements/static/ci/py3.12/lint.txt +++ b/requirements/static/ci/py3.12/lint.txt @@ -12,7 +12,7 @@ aiosignal==1.2.0 # via # -c requirements/static/ci/py3.12/linux.txt # aiohttp -ansible-core==2.16.2 +ansible-core==2.16.3 # via # -c requirements/static/ci/py3.12/linux.txt # ansible diff --git a/requirements/static/ci/py3.12/linux.txt b/requirements/static/ci/py3.12/linux.txt index 2791b36b16e..77635e19322 100644 --- a/requirements/static/ci/py3.12/linux.txt +++ b/requirements/static/ci/py3.12/linux.txt @@ -8,7 +8,7 @@ aiohttp==3.9.2 # via etcd3-py aiosignal==1.2.0 # via aiohttp -ansible-core==2.16.2 +ansible-core==2.16.3 # via ansible ansible==9.1.0 ; python_version >= "3.10" # via -r requirements/static/ci/linux.in From 3e540257c5c060dab88d25bfb4854f933b92c67d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 18 Feb 2024 20:05:43 +0000 Subject: [PATCH 79/96] Bump to `pytest==7.3.2` since it handles pytest-timeout without tracebacks --- requirements/static/ci/py3.10/cloud.txt | 3 +-- requirements/static/ci/py3.10/darwin.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 2 +- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.11/cloud.txt | 3 +-- requirements/static/ci/py3.11/darwin.txt | 2 +- requirements/static/ci/py3.11/freebsd.txt | 2 +- requirements/static/ci/py3.11/linux.txt | 2 +- requirements/static/ci/py3.11/windows.txt | 2 +- requirements/static/ci/py3.12/cloud.txt | 3 +-- requirements/static/ci/py3.12/darwin.txt | 2 +- requirements/static/ci/py3.12/freebsd.txt | 2 +- requirements/static/ci/py3.12/linux.txt | 2 +- requirements/static/ci/py3.12/windows.txt | 2 +- requirements/static/ci/py3.7/cloud.txt | 3 +-- requirements/static/ci/py3.7/freebsd.txt | 2 +- requirements/static/ci/py3.7/linux.txt | 2 +- requirements/static/ci/py3.7/windows.txt | 2 +- requirements/static/ci/py3.8/cloud.txt | 3 +-- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/cloud.txt | 3 +-- requirements/static/ci/py3.9/darwin.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- 28 files changed, 28 insertions(+), 34 deletions(-) diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index 09d77fbf660..e33e921ef0c 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -31,7 +31,6 @@ attrs==23.1.0 # -c requirements/static/ci/py3.10/linux.txt # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers @@ -497,7 +496,7 @@ pytest-timeout==1.4.2 # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/pytest.txt diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 4c26edc73f2..153133878ce 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -346,7 +346,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 85d2e70eb1e..cca5921ba8e 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -339,7 +339,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 32e36df3589..14e2992bf08 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -356,7 +356,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 1bfad4d3002..85048f0fed5 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -324,7 +324,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.11/cloud.txt b/requirements/static/ci/py3.11/cloud.txt index b22053c1d2b..80f91cea748 100644 --- a/requirements/static/ci/py3.11/cloud.txt +++ b/requirements/static/ci/py3.11/cloud.txt @@ -27,7 +27,6 @@ attrs==23.1.0 # -c requirements/static/ci/py3.11/linux.txt # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers @@ -461,7 +460,7 @@ pytest-timeout==1.4.2 # via # -c requirements/static/ci/py3.11/linux.txt # -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -c requirements/static/ci/py3.11/linux.txt # -r requirements/pytest.txt diff --git a/requirements/static/ci/py3.11/darwin.txt b/requirements/static/ci/py3.11/darwin.txt index 91b0c049738..ec406a430d4 100644 --- a/requirements/static/ci/py3.11/darwin.txt +++ b/requirements/static/ci/py3.11/darwin.txt @@ -317,7 +317,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index e824caf1b2e..3f79f305e38 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -316,7 +316,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index cf2f4fbf1c5..08c735e17db 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -333,7 +333,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index aedf67bc8aa..41bad55891a 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -320,7 +320,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.12/cloud.txt b/requirements/static/ci/py3.12/cloud.txt index 6c6fdd33144..0521d95cd29 100644 --- a/requirements/static/ci/py3.12/cloud.txt +++ b/requirements/static/ci/py3.12/cloud.txt @@ -27,7 +27,6 @@ attrs==23.1.0 # -c requirements/static/ci/py3.12/linux.txt # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers @@ -461,7 +460,7 @@ pytest-timeout==1.4.2 # via # -c requirements/static/ci/py3.12/linux.txt # -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -c requirements/static/ci/py3.12/linux.txt # -r requirements/pytest.txt diff --git a/requirements/static/ci/py3.12/darwin.txt b/requirements/static/ci/py3.12/darwin.txt index 33d4948fd84..5f4de7eb478 100644 --- a/requirements/static/ci/py3.12/darwin.txt +++ b/requirements/static/ci/py3.12/darwin.txt @@ -317,7 +317,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.12/freebsd.txt b/requirements/static/ci/py3.12/freebsd.txt index 69ef14fa266..96e736d7575 100644 --- a/requirements/static/ci/py3.12/freebsd.txt +++ b/requirements/static/ci/py3.12/freebsd.txt @@ -316,7 +316,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.12/linux.txt b/requirements/static/ci/py3.12/linux.txt index 77635e19322..449524839a9 100644 --- a/requirements/static/ci/py3.12/linux.txt +++ b/requirements/static/ci/py3.12/linux.txt @@ -333,7 +333,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.12/windows.txt b/requirements/static/ci/py3.12/windows.txt index d341675cc8c..72b927e8d09 100644 --- a/requirements/static/ci/py3.12/windows.txt +++ b/requirements/static/ci/py3.12/windows.txt @@ -320,7 +320,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 447b9143d98..34ed31e4df9 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -35,7 +35,6 @@ attrs==23.1.0 # -c requirements/static/ci/py3.7/linux.txt # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers @@ -548,7 +547,7 @@ pytest-timeout==1.4.2 # via # -c requirements/static/ci/py3.7/linux.txt # -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -c requirements/static/ci/py3.7/linux.txt # -r requirements/pytest.txt diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 470d3916c44..89f940d5969 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -381,7 +381,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index 883dd34afa6..6449dfb91f6 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -393,7 +393,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index 4196d4dd67b..169d7e7503b 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -338,7 +338,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 0d7f793b3eb..5838055eb7e 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -31,7 +31,6 @@ attrs==23.1.0 # -c requirements/static/ci/py3.8/linux.txt # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers @@ -535,7 +534,7 @@ pytest-timeout==1.4.2 # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/pytest.txt diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index b2451466a0c..e2a4f60dad7 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -368,7 +368,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index c9aff251e83..5200851196b 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -380,7 +380,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 0dc77cb40c8..03a0187ab5b 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -325,7 +325,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index aa313eaeba0..4683ea3ab04 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -31,7 +31,6 @@ attrs==23.1.0 # -c requirements/static/ci/py3.9/linux.txt # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers @@ -537,7 +536,7 @@ pytest-timeout==1.4.2 # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/pytest.txt diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index b5f5433fd82..8e44f8ab9be 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -377,7 +377,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 51ca8c39796..2b7d7083b58 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -370,7 +370,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index d5fd78085fb..392049bdbbb 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -380,7 +380,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 66cf7d68220..af1c3e1fd78 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -326,7 +326,7 @@ pytest-system-statistics==1.0.2 # via pytest-salt-factories pytest-timeout==1.4.2 # via -r requirements/pytest.txt -pytest==7.2.0 +pytest==7.3.2 # via # -r requirements/pytest.txt # pytest-custom-exit-code From 6703d19bcec18c880be12382acfb78bc2b592440 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sun, 18 Feb 2024 15:05:05 -0700 Subject: [PATCH 80/96] Upgrade pyzmq on darwin due to build failure --- requirements/static/ci/py3.10/darwin.txt | 3 +-- requirements/static/ci/py3.10/freebsd.txt | 1 - requirements/static/ci/py3.10/linux.txt | 1 - requirements/static/ci/py3.10/windows.txt | 1 - requirements/static/ci/py3.11/darwin.txt | 3 +-- requirements/static/ci/py3.11/freebsd.txt | 1 - requirements/static/ci/py3.11/linux.txt | 1 - requirements/static/ci/py3.11/windows.txt | 1 - requirements/static/ci/py3.12/darwin.txt | 3 +-- requirements/static/ci/py3.12/freebsd.txt | 1 - requirements/static/ci/py3.12/linux.txt | 1 - requirements/static/ci/py3.12/windows.txt | 1 - requirements/static/ci/py3.7/freebsd.txt | 1 - requirements/static/ci/py3.7/linux.txt | 1 - requirements/static/ci/py3.7/windows.txt | 1 - requirements/static/ci/py3.8/freebsd.txt | 1 - requirements/static/ci/py3.8/linux.txt | 1 - requirements/static/ci/py3.8/windows.txt | 1 - requirements/static/ci/py3.9/darwin.txt | 3 +-- requirements/static/ci/py3.9/freebsd.txt | 1 - requirements/static/ci/py3.9/linux.txt | 1 - requirements/static/ci/py3.9/windows.txt | 1 - requirements/static/pkg/py3.10/darwin.txt | 2 +- requirements/static/pkg/py3.11/darwin.txt | 2 +- requirements/static/pkg/py3.12/darwin.txt | 2 +- requirements/static/pkg/py3.9/darwin.txt | 2 +- requirements/zeromq.txt | 1 + 27 files changed, 9 insertions(+), 30 deletions(-) diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 153133878ce..37f5bb3c658 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -23,7 +23,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers @@ -389,7 +388,7 @@ pyyaml==6.0.1 # pytest-salt-factories # yamllint # yamlordereddictloader -pyzmq==23.2.0 +pyzmq==25.1.2 ; sys_platform == "darwin" # via # -c requirements/static/ci/../pkg/py3.10/darwin.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index cca5921ba8e..3244095d558 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -20,7 +20,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 14e2992bf08..7d0048308e8 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -26,7 +26,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 85048f0fed5..a79b830492f 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -14,7 +14,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.11/darwin.txt b/requirements/static/ci/py3.11/darwin.txt index ec406a430d4..cd1642e38cd 100644 --- a/requirements/static/ci/py3.11/darwin.txt +++ b/requirements/static/ci/py3.11/darwin.txt @@ -21,7 +21,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers @@ -359,7 +358,7 @@ pyyaml==6.0.1 # pytest-salt-factories # yamllint # yamlordereddictloader -pyzmq==23.2.0 +pyzmq==25.1.2 ; sys_platform == "darwin" # via # -c requirements/static/ci/../pkg/py3.11/darwin.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index 3f79f305e38..c73086e4d8b 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -18,7 +18,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index 08c735e17db..bd24df53f96 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -24,7 +24,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index 41bad55891a..a20c1d18ddd 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -12,7 +12,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.12/darwin.txt b/requirements/static/ci/py3.12/darwin.txt index 5f4de7eb478..25d881f51e0 100644 --- a/requirements/static/ci/py3.12/darwin.txt +++ b/requirements/static/ci/py3.12/darwin.txt @@ -21,7 +21,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers @@ -359,7 +358,7 @@ pyyaml==6.0.1 # pytest-salt-factories # yamllint # yamlordereddictloader -pyzmq==23.2.0 +pyzmq==25.1.2 ; sys_platform == "darwin" # via # -c requirements/static/ci/../pkg/py3.12/darwin.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.12/freebsd.txt b/requirements/static/ci/py3.12/freebsd.txt index 96e736d7575..437fe1ce68b 100644 --- a/requirements/static/ci/py3.12/freebsd.txt +++ b/requirements/static/ci/py3.12/freebsd.txt @@ -18,7 +18,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.12/linux.txt b/requirements/static/ci/py3.12/linux.txt index 449524839a9..07a0917bc0c 100644 --- a/requirements/static/ci/py3.12/linux.txt +++ b/requirements/static/ci/py3.12/linux.txt @@ -24,7 +24,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.12/windows.txt b/requirements/static/ci/py3.12/windows.txt index 72b927e8d09..ea1fe289fca 100644 --- a/requirements/static/ci/py3.12/windows.txt +++ b/requirements/static/ci/py3.12/windows.txt @@ -12,7 +12,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 89f940d5969..07ec679c972 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -22,7 +22,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index 6449dfb91f6..1ddfc41ea22 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -24,7 +24,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index 169d7e7503b..bcc5ae093f1 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -16,7 +16,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index e2a4f60dad7..f8e946baaa1 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -20,7 +20,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 5200851196b..1a53d473c7a 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -22,7 +22,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 03a0187ab5b..ef288e4ee13 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -14,7 +14,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 8e44f8ab9be..f8557f77af1 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -23,7 +23,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers @@ -421,7 +420,7 @@ pyyaml==6.0.1 # pytest-salt-factories # yamllint # yamlordereddictloader -pyzmq==23.2.0 +pyzmq==25.1.2 ; sys_platform == "darwin" # via # -c requirements/static/ci/../pkg/py3.9/darwin.txt # -r requirements/zeromq.txt diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 2b7d7083b58..21956a58f0b 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -20,7 +20,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index 392049bdbbb..30e49f3c3cf 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -22,7 +22,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index af1c3e1fd78..bae0010995f 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -14,7 +14,6 @@ attrs==23.1.0 # via # aiohttp # jsonschema - # pytest # pytest-salt-factories # pytest-shell-utilities # pytest-skip-markers diff --git a/requirements/static/pkg/py3.10/darwin.txt b/requirements/static/pkg/py3.10/darwin.txt index 580aee71cea..060218c604a 100644 --- a/requirements/static/pkg/py3.10/darwin.txt +++ b/requirements/static/pkg/py3.10/darwin.txt @@ -91,7 +91,7 @@ pytz==2022.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==23.2.0 +pyzmq==25.1.2 ; sys_platform == "darwin" # via -r requirements/zeromq.txt requests==2.31.0 # via diff --git a/requirements/static/pkg/py3.11/darwin.txt b/requirements/static/pkg/py3.11/darwin.txt index 7115c10c033..93a12c65f74 100644 --- a/requirements/static/pkg/py3.11/darwin.txt +++ b/requirements/static/pkg/py3.11/darwin.txt @@ -91,7 +91,7 @@ pytz==2022.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==23.2.0 +pyzmq==25.1.2 ; sys_platform == "darwin" # via -r requirements/zeromq.txt requests==2.31.0 # via diff --git a/requirements/static/pkg/py3.12/darwin.txt b/requirements/static/pkg/py3.12/darwin.txt index e933c26b1c3..ca320d1f669 100644 --- a/requirements/static/pkg/py3.12/darwin.txt +++ b/requirements/static/pkg/py3.12/darwin.txt @@ -91,7 +91,7 @@ pytz==2022.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==23.2.0 +pyzmq==25.1.2 ; sys_platform == "darwin" # via -r requirements/zeromq.txt requests==2.31.0 # via diff --git a/requirements/static/pkg/py3.9/darwin.txt b/requirements/static/pkg/py3.9/darwin.txt index b69c8e5458f..86f87a546ee 100644 --- a/requirements/static/pkg/py3.9/darwin.txt +++ b/requirements/static/pkg/py3.9/darwin.txt @@ -91,7 +91,7 @@ pytz==2022.1 # via tempora pyyaml==6.0.1 # via -r requirements/base.txt -pyzmq==23.2.0 +pyzmq==25.1.2 ; sys_platform == "darwin" # via -r requirements/zeromq.txt requests==2.31.0 # via diff --git a/requirements/zeromq.txt b/requirements/zeromq.txt index 1e9a815c1b6..99979ab8854 100644 --- a/requirements/zeromq.txt +++ b/requirements/zeromq.txt @@ -3,3 +3,4 @@ pyzmq>=20.0.0 pyzmq==25.0.2 ; sys_platform == "win32" +pyzmq==25.1.2 ; sys_platform == "darwin" From 661c216fa4ed01e7bff784af9fb8471d2184b5fe Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sun, 18 Feb 2024 18:20:43 -0700 Subject: [PATCH 81/96] Try disconnecting while we wait --- salt/modules/mac_assistive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/mac_assistive.py b/salt/modules/mac_assistive.py index 90ab8814146..e53c750bd7b 100644 --- a/salt/modules/mac_assistive.py +++ b/salt/modules/mac_assistive.py @@ -72,12 +72,12 @@ def install(app_id, enable=True, tries=3, wait=10): "Error installing app({}): {}".format(app_id, exc) ) elif num_tries < tries: - time.sleep(wait) num_tries += 1 else: raise CommandExecutionError( "Error installing app({}): {}".format(app_id, exc) ) + time.sleep(wait) def installed(app_id): From 75db7358678af45b70b1d4d304edb8e0fb9bff0e Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Fri, 16 Feb 2024 11:05:08 -0700 Subject: [PATCH 82/96] Fix an issue with unresolved grains on Windows Some WMI calls are returning empty, maybe something is corrupted underneath. This will just return None for grains that can't be collected using WMI. --- changelog/65154.fixed.md | 2 + salt/grains/core.py | 237 ++++++++++++------ tests/pytests/unit/grains/test_core.py | 69 ++--- .../grains/test_core_windows_platform_data.py | 223 ++++++++++++++++ 4 files changed, 399 insertions(+), 132 deletions(-) create mode 100644 changelog/65154.fixed.md create mode 100644 tests/pytests/unit/grains/test_core_windows_platform_data.py diff --git a/changelog/65154.fixed.md b/changelog/65154.fixed.md new file mode 100644 index 00000000000..bbc6d8d7ec5 --- /dev/null +++ b/changelog/65154.fixed.md @@ -0,0 +1,2 @@ +Fix an issue where the minion would crash on Windows if some of the grains +failed to resolve diff --git a/salt/grains/core.py b/salt/grains/core.py index 5ac64007564..df53ccddd45 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -729,46 +729,62 @@ def _windows_virtual(osdata): if osdata["kernel"] != "Windows": return grains - grains["virtual"] = osdata.get("virtual", "physical") + # Set the default virtual environment to physical, meaning not a VM + grains["virtual"] = "physical" - # It is possible that the 'manufacturer' and/or 'productname' grains - # exist but have a value of None. + # It is possible that the 'manufacturer' and/or 'productname' grains exist + # but have a value of None manufacturer = osdata.get("manufacturer", "") if manufacturer is None: manufacturer = "" - productname = osdata.get("productname", "") - if productname is None: - productname = "" + product_name = osdata.get("productname", "") + if product_name is None: + product_name = "" + bios_string = osdata.get("biosstring", "") + if bios_string is None: + bios_string = "" if "QEMU" in manufacturer: # FIXME: Make this detect between kvm or qemu grains["virtual"] = "kvm" - if "Bochs" in manufacturer: + elif "VRTUAL" in bios_string: # (not a typo) + grains["virtual"] = "HyperV" + elif "A M I" in bios_string: + grains["virtual"] = "VirtualPC" + elif "Xen" in bios_string: + grains["virtual"] = "Xen" + if "HVM domU" in product_name: + grains["virtual_subtype"] = "HVM domU" + elif "AMAZON" in bios_string: + grains["virtual"] = "EC2" + elif "Bochs" in manufacturer: grains["virtual"] = "kvm" # Product Name: (oVirt) www.ovirt.org # Red Hat Community virtualization Project based on kvm - elif "oVirt" in productname: + elif "oVirt" in product_name: grains["virtual"] = "kvm" grains["virtual_subtype"] = "oVirt" # Red Hat Enterprise Virtualization - elif "RHEV Hypervisor" in productname: + elif "RHEV Hypervisor" in product_name: grains["virtual"] = "kvm" grains["virtual_subtype"] = "rhev" # Product Name: VirtualBox - elif "VirtualBox" in productname: + elif "VirtualBox" in product_name: grains["virtual"] = "VirtualBox" # Product Name: VMware Virtual Platform - elif "VMware" in productname: + elif "VMware" in product_name: grains["virtual"] = "VMware" # Manufacturer: Microsoft Corporation # Product Name: Virtual Machine - elif "Microsoft" in manufacturer and "Virtual Machine" in productname: + elif "Microsoft" in manufacturer and "Virtual Machine" in product_name: grains["virtual"] = "VirtualPC" + elif "OpenStack" in product_name: + grains["virtual"] = "OpenStack" # Manufacturer: Parallels Software International Inc. elif "Parallels" in manufacturer: grains["virtual"] = "Parallels" # Apache CloudStack - elif "CloudStack KVM Hypervisor" in productname: + elif "CloudStack KVM Hypervisor" in product_name: grains["virtual"] = "kvm" grains["virtual_subtype"] = "cloudstack" return grains @@ -1502,88 +1518,143 @@ def _windows_platform_data(): if not HAS_WMI: return {} + grains = {} with salt.utils.winapi.Com(): wmi_c = wmi.WMI() - # http://msdn.microsoft.com/en-us/library/windows/desktop/aa394102%28v=vs.85%29.aspx - systeminfo = wmi_c.Win32_ComputerSystem()[0] - # https://msdn.microsoft.com/en-us/library/aa394239(v=vs.85).aspx - osinfo = wmi_c.Win32_OperatingSystem()[0] - # http://msdn.microsoft.com/en-us/library/windows/desktop/aa394077(v=vs.85).aspx - biosinfo = wmi_c.Win32_BIOS()[0] - # http://msdn.microsoft.com/en-us/library/windows/desktop/aa394498(v=vs.85).aspx - timeinfo = wmi_c.Win32_TimeZone()[0] - # https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-computersystemproduct - csproductinfo = wmi_c.Win32_ComputerSystemProduct()[0] + try: + # http://msdn.microsoft.com/en-us/library/windows/desktop/aa394102%28v=vs.85%29.aspx + systeminfo = wmi_c.Win32_ComputerSystem()[0] + grains.update( + { + "manufacturer": _clean_value( + "manufacturer", systeminfo.Manufacturer + ), + "productname": _clean_value("productname", systeminfo.Model), + } + ) + except IndexError: + grains.update({"manufacturer": None, "productname": None}) + log.warning("Computer System info not available on this system") + + try: + # https://msdn.microsoft.com/en-us/library/aa394239(v=vs.85).aspx + osinfo = wmi_c.Win32_OperatingSystem()[0] + os_release = _windows_os_release_grain( + caption=osinfo.Caption, product_type=osinfo.ProductType + ) + grains.update( + { + "kernelrelease": _clean_value("kernelrelease", osinfo.Version), + "osfullname": _clean_value("osfullname", osinfo.Caption), + "osmanufacturer": _clean_value( + "osmanufacturer", osinfo.Manufacturer + ), + "osrelease": _clean_value("osrelease", os_release), + "osversion": _clean_value("osversion", osinfo.Version), + } + ) + except IndexError: + grains.update( + { + "kernelrelease": None, + "osfullname": None, + "osmanufacturer": None, + "osrelease": None, + "osversion": None, + } + ) + log.warning("Operating System info not available on this system") + + try: + # http://msdn.microsoft.com/en-us/library/windows/desktop/aa394077(v=vs.85).aspx + biosinfo = wmi_c.Win32_BIOS()[0] + grains.update( + { + # bios name had a bunch of whitespace appended to it in my testing + # 'PhoenixBIOS 4.0 Release 6.0 ' + "biosversion": _clean_value("biosversion", biosinfo.Name.strip()), + "biosstring": _clean_value("string", biosinfo.Version), + "serialnumber": _clean_value("serialnumber", biosinfo.SerialNumber), + } + ) + except IndexError: + grains.update( + {"biosstring": None, "biosversion": None, "serialnumber": None} + ) + log.warning("BIOS info not available on this system") + + try: + # http://msdn.microsoft.com/en-us/library/windows/desktop/aa394498(v=vs.85).aspx + timeinfo = wmi_c.Win32_TimeZone()[0] + grains.update( + { + "timezone": _clean_value("timezone", timeinfo.Description), + } + ) + except IndexError: + grains.update({"timezone": None}) + log.warning("TimeZone info not available on this system") + + try: + # https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-computersystemproduct + csproductinfo = wmi_c.Win32_ComputerSystemProduct()[0] + grains.update( + { + "uuid": _clean_value("uuid", csproductinfo.UUID.lower()), + } + ) + except IndexError: + grains.update({"uuid": None}) + log.warning("Computer System Product info not available on this system") # http://msdn.microsoft.com/en-us/library/windows/desktop/aa394072(v=vs.85).aspx - motherboard = {"product": None, "serial": None} try: motherboardinfo = wmi_c.Win32_BaseBoard()[0] - motherboard["product"] = motherboardinfo.Product - motherboard["serial"] = motherboardinfo.SerialNumber + grains.update( + { + "motherboard": { + "productname": _clean_value( + "motherboard.productname", motherboardinfo.Product + ), + "serialnumber": _clean_value( + "motherboard.serialnumber", motherboardinfo.SerialNumber + ), + }, + } + ) except IndexError: + grains.update( + { + "motherboard": {"productname": None, "serialnumber": None}, + } + ) log.debug("Motherboard info not available on this system") - kernel_version = platform.version() - info = salt.utils.win_osinfo.get_os_version_info() + grains.update( + { + "kernelversion": _clean_value("kernelversion", platform.version()), + } + ) net_info = salt.utils.win_osinfo.get_join_info() - - service_pack = None - if info["ServicePackMajor"] > 0: - service_pack = "".join(["SP", str(info["ServicePackMajor"])]) - - os_release = _windows_os_release_grain( - caption=osinfo.Caption, product_type=osinfo.ProductType + grains.update( + { + "windowsdomain": _clean_value("windowsdomain", net_info["Domain"]), + "windowsdomaintype": _clean_value( + "windowsdomaintype", net_info["DomainType"] + ), + } ) - grains = { - "kernelrelease": _clean_value("kernelrelease", osinfo.Version), - "kernelversion": _clean_value("kernelversion", kernel_version), - "osversion": _clean_value("osversion", osinfo.Version), - "osrelease": _clean_value("osrelease", os_release), - "osservicepack": _clean_value("osservicepack", service_pack), - "osmanufacturer": _clean_value("osmanufacturer", osinfo.Manufacturer), - "manufacturer": _clean_value("manufacturer", systeminfo.Manufacturer), - "productname": _clean_value("productname", systeminfo.Model), - # bios name had a bunch of whitespace appended to it in my testing - # 'PhoenixBIOS 4.0 Release 6.0 ' - "biosversion": _clean_value("biosversion", biosinfo.Name.strip()), - "serialnumber": _clean_value("serialnumber", biosinfo.SerialNumber), - "osfullname": _clean_value("osfullname", osinfo.Caption), - "timezone": _clean_value("timezone", timeinfo.Description), - "uuid": _clean_value("uuid", csproductinfo.UUID.lower()), - "windowsdomain": _clean_value("windowsdomain", net_info["Domain"]), - "windowsdomaintype": _clean_value( - "windowsdomaintype", net_info["DomainType"] - ), - "motherboard": { - "productname": _clean_value( - "motherboard.productname", motherboard["product"] - ), - "serialnumber": _clean_value( - "motherboard.serialnumber", motherboard["serial"] - ), - }, - } - - # test for virtualized environments - # I only had VMware available so the rest are unvalidated - if "VRTUAL" in biosinfo.Version: # (not a typo) - grains["virtual"] = "HyperV" - elif "A M I" in biosinfo.Version: - grains["virtual"] = "VirtualPC" - elif "VMware" in systeminfo.Model: - grains["virtual"] = "VMware" - elif "VirtualBox" in systeminfo.Model: - grains["virtual"] = "VirtualBox" - elif "Xen" in biosinfo.Version: - grains["virtual"] = "Xen" - if "HVM domU" in systeminfo.Model: - grains["virtual_subtype"] = "HVM domU" - elif "OpenStack" in systeminfo.Model: - grains["virtual"] = "OpenStack" - elif "AMAZON" in biosinfo.Version: - grains["virtual"] = "EC2" + info = salt.utils.win_osinfo.get_os_version_info() + if info["ServicePackMajor"] > 0: + service_pack = "".join(["SP", str(info["ServicePackMajor"])]) + grains.update( + { + "osservicepack": _clean_value("osservicepack", service_pack), + } + ) + else: + grains.update({"osservicepack": None}) return grains diff --git a/tests/pytests/unit/grains/test_core.py b/tests/pytests/unit/grains/test_core.py index a4d3903af83..a87451af336 100644 --- a/tests/pytests/unit/grains/test_core.py +++ b/tests/pytests/unit/grains/test_core.py @@ -2868,6 +2868,10 @@ def test_virtual_has_virtual_grain(): assert virtual_grains["virtual"] != "physical" +def test__windows_platform_data(): + pass + + @pytest.mark.skip_unless_on_windows @pytest.mark.parametrize( ("osdata", "expected"), @@ -2875,6 +2879,13 @@ def test_virtual_has_virtual_grain(): ({"kernel": "Not Windows"}, {}), ({"kernel": "Windows"}, {"virtual": "physical"}), ({"kernel": "Windows", "manufacturer": "QEMU"}, {"virtual": "kvm"}), + ({"kernel": "Windows", "biosstring": "VRTUAL"}, {"virtual": "HyperV"}), + ({"kernel": "Windows", "biosstring": "A M I"}, {"virtual": "VirtualPC"}), + ( + {"kernel": "Windows", "biosstring": "Xen", "productname": "HVM domU"}, + {"virtual": "Xen", "virtual_subtype": "HVM domU"}, + ), + ({"kernel": "Windows", "biosstring": "AMAZON"}, {"virtual": "EC2"}), ({"kernel": "Windows", "manufacturer": "Bochs"}, {"virtual": "kvm"}), ( {"kernel": "Windows", "productname": "oVirt"}, @@ -2884,10 +2895,6 @@ def test_virtual_has_virtual_grain(): {"kernel": "Windows", "productname": "RHEV Hypervisor"}, {"virtual": "kvm", "virtual_subtype": "rhev"}, ), - ( - {"kernel": "Windows", "productname": "CloudStack KVM Hypervisor"}, - {"virtual": "kvm", "virtual_subtype": "cloudstack"}, - ), ( {"kernel": "Windows", "productname": "VirtualBox"}, {"virtual": "VirtualBox"}, @@ -2915,6 +2922,7 @@ def test_virtual_has_virtual_grain(): }, {"virtual": "VirtualPC"}, ), + ({"kernel": "Windows", "productname": "OpenStack"}, {"virtual": "OpenStack"}), ( {"kernel": "Windows", "manufacturer": "Parallels Software"}, {"virtual": "Parallels"}, @@ -2923,6 +2931,10 @@ def test_virtual_has_virtual_grain(): {"kernel": "Windows", "manufacturer": None, "productname": None}, {"virtual": "physical"}, ), + ( + {"kernel": "Windows", "productname": "CloudStack KVM Hypervisor"}, + {"virtual": "kvm", "virtual_subtype": "cloudstack"}, + ), ], ) def test__windows_virtual(osdata, expected): @@ -2943,17 +2955,7 @@ def test_windows_virtual_set_virtual_grain(): _, ) = platform.uname() - with patch.dict( - core.__salt__, - { - "cmd.run": salt.modules.cmdmod.run, - "cmd.run_all": salt.modules.cmdmod.run_all, - "cmd.retcode": salt.modules.cmdmod.retcode, - "smbios.get": salt.modules.smbios.get, - }, - ): - - virtual_grains = core._windows_virtual(osdata) + virtual_grains = core._windows_virtual(osdata) assert "virtual" in virtual_grains @@ -2971,46 +2973,15 @@ def test_windows_virtual_has_virtual_grain(): _, ) = platform.uname() - with patch.dict( - core.__salt__, - { - "cmd.run": salt.modules.cmdmod.run, - "cmd.run_all": salt.modules.cmdmod.run_all, - "cmd.retcode": salt.modules.cmdmod.retcode, - "smbios.get": salt.modules.smbios.get, - }, - ): - - virtual_grains = core._windows_virtual(osdata) + virtual_grains = core._windows_virtual(osdata) assert "virtual" in virtual_grains - assert virtual_grains["virtual"] != "physical" @pytest.mark.skip_unless_on_windows def test_osdata_virtual_key_win(): - with patch.dict( - core.__salt__, - { - "cmd.run": salt.modules.cmdmod.run, - "cmd.run_all": salt.modules.cmdmod.run_all, - "cmd.retcode": salt.modules.cmdmod.retcode, - "smbios.get": salt.modules.smbios.get, - }, - ): - - _windows_platform_data_ret = core.os_data() - _windows_platform_data_ret["virtual"] = "something" - - with patch.object( - core, "_windows_platform_data", return_value=_windows_platform_data_ret - ) as _windows_platform_data: - - osdata_grains = core.os_data() - _windows_platform_data.assert_called_once() - - assert "virtual" in osdata_grains - assert osdata_grains["virtual"] != "physical" + osdata_grains = core.os_data() + assert "virtual" in osdata_grains @pytest.mark.skip_unless_on_linux diff --git a/tests/pytests/unit/grains/test_core_windows_platform_data.py b/tests/pytests/unit/grains/test_core_windows_platform_data.py new file mode 100644 index 00000000000..cb38ff72aea --- /dev/null +++ b/tests/pytests/unit/grains/test_core_windows_platform_data.py @@ -0,0 +1,223 @@ +import pytest + +import salt.grains.core as core +from tests.support.mock import MagicMock, Mock, patch + +pytestmark = [ + pytest.mark.skip_unless_on_windows, +] + +wmi = pytest.importorskip("wmi", reason="WMI only available on Windows") + + +def test__windows_platform_data_index_errors(): + # mock = [MagicMock(Manufacturer="Dell Inc.", Model="Precision 5820 Tower")] + # mock = [MagicMock( + # Version="10.0.22631", + # Caption="Microsoft Windows 11 Enterprise", + # Manufacturer="Microsoft Corporation", + # ProductType=1, + # )] + + WMI = Mock() + platform_version = "1.2.3" + os_version_info = {"Domain": "test", "DomainType": "test_type"} + + with ( + patch("salt.utils.winapi.Com", MagicMock()), + patch.object(wmi, "WMI", Mock(return_value=WMI)), + patch.object(WMI, "Win32_ComputerSystem", return_value=[]), + patch.object(WMI, "Win32_OperatingSystem", return_value=[]), + patch.object(WMI, "Win32_BIOS", return_value=[]), + patch.object(WMI, "Win32_TimeZone", return_value=[]), + patch.object(WMI, "Win32_ComputerSystemProduct", return_value=[]), + patch.object(WMI, "Win32_BaseBoard", return_value=[]), + patch("platform.version", return_value=platform_version), + patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + ): + result = core._windows_platform_data() + expected = { + "biosstring": None, + "biosversion": None, + "kernelrelease": None, + "kernelversion": platform_version, + "manufacturer": None, + "motherboard": {"productname": None, "serialnumber": None}, + "osfullname": None, + "osmanufacturer": None, + "osrelease": None, + "osservicepack": None, + "osversion": None, + "productname": None, + "serialnumber": None, + "timezone": None, + "uuid": None, + "windowsdomain": os_version_info["Domain"], + "windowsdomaintype": os_version_info["DomainType"], + } + assert result == expected + + +def test__windows_platform_data_computer_system(): + mock = [MagicMock(Manufacturer="Dell Inc.", Model="Precision 5820 Tower")] + WMI = Mock() + platform_version = "1.2.3" + os_version_info = {"Domain": "test", "DomainType": "test_type"} + with ( + patch("salt.utils.winapi.Com", MagicMock()), + patch.object(wmi, "WMI", Mock(return_value=WMI)), + patch.object(WMI, "Win32_ComputerSystem", return_value=mock), + patch.object(WMI, "Win32_OperatingSystem", return_value=[]), + patch.object(WMI, "Win32_BIOS", return_value=[]), + patch.object(WMI, "Win32_TimeZone", return_value=[]), + patch.object(WMI, "Win32_ComputerSystemProduct", return_value=[]), + patch.object(WMI, "Win32_BaseBoard", return_value=[]), + patch("platform.version", return_value=platform_version), + patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + ): + result = core._windows_platform_data() + assert result["manufacturer"] == "Dell Inc." + assert result["productname"] == "Precision 5820 Tower" + + +def test__windows_platform_data_operating_system(): + mock = [ + MagicMock( + Version="10.0.22631", + Caption="Microsoft Windows 11 Enterprise", + Manufacturer="Microsoft Corporation", + ProductType=1, + ) + ] + + WMI = Mock() + platform_version = "1.2.3" + os_version_info = {"Domain": "test", "DomainType": "test_type"} + with ( + patch("salt.utils.winapi.Com", MagicMock()), + patch.object(wmi, "WMI", Mock(return_value=WMI)), + patch.object(WMI, "Win32_ComputerSystem", return_value=[]), + patch.object(WMI, "Win32_OperatingSystem", return_value=mock), + patch.object(WMI, "Win32_BIOS", return_value=[]), + patch.object(WMI, "Win32_TimeZone", return_value=[]), + patch.object(WMI, "Win32_ComputerSystemProduct", return_value=[]), + patch.object(WMI, "Win32_BaseBoard", return_value=[]), + patch("platform.version", return_value=platform_version), + patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + ): + result = core._windows_platform_data() + assert result["kernelrelease"] == "10.0.22631" + assert result["osfullname"] == "Microsoft Windows 11 Enterprise" + assert result["osmanufacturer"] == "Microsoft Corporation" + assert result["osrelease"] == "11" + assert result["osversion"] == "10.0.22631" + + +def test__windows_platform_data_bios(): + mock = [ + MagicMock( + Name="11.22.33", + Version="DELL - 1072009", + SerialNumber="BCF3H13", + ) + ] + + WMI = Mock() + platform_version = "1.2.3" + os_version_info = {"Domain": "test", "DomainType": "test_type"} + with ( + patch("salt.utils.winapi.Com", MagicMock()), + patch.object(wmi, "WMI", Mock(return_value=WMI)), + patch.object(WMI, "Win32_ComputerSystem", return_value=[]), + patch.object(WMI, "Win32_OperatingSystem", return_value=[]), + patch.object(WMI, "Win32_BIOS", return_value=mock), + patch.object(WMI, "Win32_TimeZone", return_value=[]), + patch.object(WMI, "Win32_ComputerSystemProduct", return_value=[]), + patch.object(WMI, "Win32_BaseBoard", return_value=[]), + patch("platform.version", return_value=platform_version), + patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + ): + result = core._windows_platform_data() + assert result["biosversion"] == "11.22.33" + assert result["biosstring"] == "DELL - 1072009" + assert result["serialnumber"] == "BCF3H13" + + +def test__windows_platform_data_timezone(): + mock = [ + MagicMock( + Description="(UTC-07:00) Mountain Time (US & Canada)", + ) + ] + + WMI = Mock() + platform_version = "1.2.3" + os_version_info = {"Domain": "test", "DomainType": "test_type"} + with ( + patch("salt.utils.winapi.Com", MagicMock()), + patch.object(wmi, "WMI", Mock(return_value=WMI)), + patch.object(WMI, "Win32_ComputerSystem", return_value=[]), + patch.object(WMI, "Win32_OperatingSystem", return_value=[]), + patch.object(WMI, "Win32_BIOS", return_value=[]), + patch.object(WMI, "Win32_TimeZone", return_value=mock), + patch.object(WMI, "Win32_ComputerSystemProduct", return_value=[]), + patch.object(WMI, "Win32_BaseBoard", return_value=[]), + patch("platform.version", return_value=platform_version), + patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + ): + result = core._windows_platform_data() + assert result["timezone"] == "(UTC-07:00) Mountain Time (US & Canada)" + + +def test__windows_platform_data_computer_system_product(): + mock = [ + MagicMock( + UUID="4C4C4544-0043-4610-8030-C2C04F483033", + ) + ] + + WMI = Mock() + platform_version = "1.2.3" + os_version_info = {"Domain": "test", "DomainType": "test_type"} + with ( + patch("salt.utils.winapi.Com", MagicMock()), + patch.object(wmi, "WMI", Mock(return_value=WMI)), + patch.object(WMI, "Win32_ComputerSystem", return_value=[]), + patch.object(WMI, "Win32_OperatingSystem", return_value=[]), + patch.object(WMI, "Win32_BIOS", return_value=[]), + patch.object(WMI, "Win32_TimeZone", return_value=[]), + patch.object(WMI, "Win32_ComputerSystemProduct", return_value=mock), + patch.object(WMI, "Win32_BaseBoard", return_value=[]), + patch("platform.version", return_value=platform_version), + patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + ): + result = core._windows_platform_data() + assert result["uuid"] == "4c4c4544-0043-4610-8030-c2c04f483033" + + +def test__windows_platform_data_baseboard(): + mock = [ + MagicMock( + Product="002KVM", + SerialNumber="/BCF0H03/CNFCW0097F00TM/", + ) + ] + + WMI = Mock() + platform_version = "1.2.3" + os_version_info = {"Domain": "test", "DomainType": "test_type"} + with ( + patch("salt.utils.winapi.Com", MagicMock()), + patch.object(wmi, "WMI", Mock(return_value=WMI)), + patch.object(WMI, "Win32_ComputerSystem", return_value=[]), + patch.object(WMI, "Win32_OperatingSystem", return_value=[]), + patch.object(WMI, "Win32_BIOS", return_value=[]), + patch.object(WMI, "Win32_TimeZone", return_value=[]), + patch.object(WMI, "Win32_ComputerSystemProduct", return_value=[]), + patch.object(WMI, "Win32_BaseBoard", return_value=mock), + patch("platform.version", return_value=platform_version), + patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + ): + result = core._windows_platform_data() + assert result["motherboard"]["productname"] == "002KVM" + assert result["motherboard"]["serialnumber"] == "/BCF0H03/CNFCW0097F00TM/" From 6b98f0d82882f0c271e2976592f86f24f25525f3 Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Fri, 16 Feb 2024 13:10:07 -0700 Subject: [PATCH 83/96] Fix lint error --- .../grains/test_core_windows_platform_data.py | 189 +++++++++++------- 1 file changed, 112 insertions(+), 77 deletions(-) diff --git a/tests/pytests/unit/grains/test_core_windows_platform_data.py b/tests/pytests/unit/grains/test_core_windows_platform_data.py index cb38ff72aea..6c5865bb034 100644 --- a/tests/pytests/unit/grains/test_core_windows_platform_data.py +++ b/tests/pytests/unit/grains/test_core_windows_platform_data.py @@ -23,17 +23,22 @@ def test__windows_platform_data_index_errors(): platform_version = "1.2.3" os_version_info = {"Domain": "test", "DomainType": "test_type"} - with ( - patch("salt.utils.winapi.Com", MagicMock()), - patch.object(wmi, "WMI", Mock(return_value=WMI)), - patch.object(WMI, "Win32_ComputerSystem", return_value=[]), - patch.object(WMI, "Win32_OperatingSystem", return_value=[]), - patch.object(WMI, "Win32_BIOS", return_value=[]), - patch.object(WMI, "Win32_TimeZone", return_value=[]), - patch.object(WMI, "Win32_ComputerSystemProduct", return_value=[]), - patch.object(WMI, "Win32_BaseBoard", return_value=[]), - patch("platform.version", return_value=platform_version), - patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + with patch("salt.utils.winapi.Com", MagicMock()), patch.object( + wmi, "WMI", Mock(return_value=WMI) + ), patch.object(WMI, "Win32_ComputerSystem", return_value=[]), patch.object( + WMI, "Win32_OperatingSystem", return_value=[] + ), patch.object( + WMI, "Win32_BIOS", return_value=[] + ), patch.object( + WMI, "Win32_TimeZone", return_value=[] + ), patch.object( + WMI, "Win32_ComputerSystemProduct", return_value=[] + ), patch.object( + WMI, "Win32_BaseBoard", return_value=[] + ), patch( + "platform.version", return_value=platform_version + ), patch( + "salt.utils.win_osinfo.get_join_info", return_value=os_version_info ): result = core._windows_platform_data() expected = { @@ -63,17 +68,22 @@ def test__windows_platform_data_computer_system(): WMI = Mock() platform_version = "1.2.3" os_version_info = {"Domain": "test", "DomainType": "test_type"} - with ( - patch("salt.utils.winapi.Com", MagicMock()), - patch.object(wmi, "WMI", Mock(return_value=WMI)), - patch.object(WMI, "Win32_ComputerSystem", return_value=mock), - patch.object(WMI, "Win32_OperatingSystem", return_value=[]), - patch.object(WMI, "Win32_BIOS", return_value=[]), - patch.object(WMI, "Win32_TimeZone", return_value=[]), - patch.object(WMI, "Win32_ComputerSystemProduct", return_value=[]), - patch.object(WMI, "Win32_BaseBoard", return_value=[]), - patch("platform.version", return_value=platform_version), - patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + with patch("salt.utils.winapi.Com", MagicMock()), patch.object( + wmi, "WMI", Mock(return_value=WMI) + ), patch.object(WMI, "Win32_ComputerSystem", return_value=mock), patch.object( + WMI, "Win32_OperatingSystem", return_value=[] + ), patch.object( + WMI, "Win32_BIOS", return_value=[] + ), patch.object( + WMI, "Win32_TimeZone", return_value=[] + ), patch.object( + WMI, "Win32_ComputerSystemProduct", return_value=[] + ), patch.object( + WMI, "Win32_BaseBoard", return_value=[] + ), patch( + "platform.version", return_value=platform_version + ), patch( + "salt.utils.win_osinfo.get_join_info", return_value=os_version_info ): result = core._windows_platform_data() assert result["manufacturer"] == "Dell Inc." @@ -93,17 +103,22 @@ def test__windows_platform_data_operating_system(): WMI = Mock() platform_version = "1.2.3" os_version_info = {"Domain": "test", "DomainType": "test_type"} - with ( - patch("salt.utils.winapi.Com", MagicMock()), - patch.object(wmi, "WMI", Mock(return_value=WMI)), - patch.object(WMI, "Win32_ComputerSystem", return_value=[]), - patch.object(WMI, "Win32_OperatingSystem", return_value=mock), - patch.object(WMI, "Win32_BIOS", return_value=[]), - patch.object(WMI, "Win32_TimeZone", return_value=[]), - patch.object(WMI, "Win32_ComputerSystemProduct", return_value=[]), - patch.object(WMI, "Win32_BaseBoard", return_value=[]), - patch("platform.version", return_value=platform_version), - patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + with patch("salt.utils.winapi.Com", MagicMock()), patch.object( + wmi, "WMI", Mock(return_value=WMI) + ), patch.object(WMI, "Win32_ComputerSystem", return_value=[]), patch.object( + WMI, "Win32_OperatingSystem", return_value=mock + ), patch.object( + WMI, "Win32_BIOS", return_value=[] + ), patch.object( + WMI, "Win32_TimeZone", return_value=[] + ), patch.object( + WMI, "Win32_ComputerSystemProduct", return_value=[] + ), patch.object( + WMI, "Win32_BaseBoard", return_value=[] + ), patch( + "platform.version", return_value=platform_version + ), patch( + "salt.utils.win_osinfo.get_join_info", return_value=os_version_info ): result = core._windows_platform_data() assert result["kernelrelease"] == "10.0.22631" @@ -125,17 +140,22 @@ def test__windows_platform_data_bios(): WMI = Mock() platform_version = "1.2.3" os_version_info = {"Domain": "test", "DomainType": "test_type"} - with ( - patch("salt.utils.winapi.Com", MagicMock()), - patch.object(wmi, "WMI", Mock(return_value=WMI)), - patch.object(WMI, "Win32_ComputerSystem", return_value=[]), - patch.object(WMI, "Win32_OperatingSystem", return_value=[]), - patch.object(WMI, "Win32_BIOS", return_value=mock), - patch.object(WMI, "Win32_TimeZone", return_value=[]), - patch.object(WMI, "Win32_ComputerSystemProduct", return_value=[]), - patch.object(WMI, "Win32_BaseBoard", return_value=[]), - patch("platform.version", return_value=platform_version), - patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + with patch("salt.utils.winapi.Com", MagicMock()), patch.object( + wmi, "WMI", Mock(return_value=WMI) + ), patch.object(WMI, "Win32_ComputerSystem", return_value=[]), patch.object( + WMI, "Win32_OperatingSystem", return_value=[] + ), patch.object( + WMI, "Win32_BIOS", return_value=mock + ), patch.object( + WMI, "Win32_TimeZone", return_value=[] + ), patch.object( + WMI, "Win32_ComputerSystemProduct", return_value=[] + ), patch.object( + WMI, "Win32_BaseBoard", return_value=[] + ), patch( + "platform.version", return_value=platform_version + ), patch( + "salt.utils.win_osinfo.get_join_info", return_value=os_version_info ): result = core._windows_platform_data() assert result["biosversion"] == "11.22.33" @@ -153,17 +173,22 @@ def test__windows_platform_data_timezone(): WMI = Mock() platform_version = "1.2.3" os_version_info = {"Domain": "test", "DomainType": "test_type"} - with ( - patch("salt.utils.winapi.Com", MagicMock()), - patch.object(wmi, "WMI", Mock(return_value=WMI)), - patch.object(WMI, "Win32_ComputerSystem", return_value=[]), - patch.object(WMI, "Win32_OperatingSystem", return_value=[]), - patch.object(WMI, "Win32_BIOS", return_value=[]), - patch.object(WMI, "Win32_TimeZone", return_value=mock), - patch.object(WMI, "Win32_ComputerSystemProduct", return_value=[]), - patch.object(WMI, "Win32_BaseBoard", return_value=[]), - patch("platform.version", return_value=platform_version), - patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + with patch("salt.utils.winapi.Com", MagicMock()), patch.object( + wmi, "WMI", Mock(return_value=WMI) + ), patch.object(WMI, "Win32_ComputerSystem", return_value=[]), patch.object( + WMI, "Win32_OperatingSystem", return_value=[] + ), patch.object( + WMI, "Win32_BIOS", return_value=[] + ), patch.object( + WMI, "Win32_TimeZone", return_value=mock + ), patch.object( + WMI, "Win32_ComputerSystemProduct", return_value=[] + ), patch.object( + WMI, "Win32_BaseBoard", return_value=[] + ), patch( + "platform.version", return_value=platform_version + ), patch( + "salt.utils.win_osinfo.get_join_info", return_value=os_version_info ): result = core._windows_platform_data() assert result["timezone"] == "(UTC-07:00) Mountain Time (US & Canada)" @@ -179,17 +204,22 @@ def test__windows_platform_data_computer_system_product(): WMI = Mock() platform_version = "1.2.3" os_version_info = {"Domain": "test", "DomainType": "test_type"} - with ( - patch("salt.utils.winapi.Com", MagicMock()), - patch.object(wmi, "WMI", Mock(return_value=WMI)), - patch.object(WMI, "Win32_ComputerSystem", return_value=[]), - patch.object(WMI, "Win32_OperatingSystem", return_value=[]), - patch.object(WMI, "Win32_BIOS", return_value=[]), - patch.object(WMI, "Win32_TimeZone", return_value=[]), - patch.object(WMI, "Win32_ComputerSystemProduct", return_value=mock), - patch.object(WMI, "Win32_BaseBoard", return_value=[]), - patch("platform.version", return_value=platform_version), - patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + with patch("salt.utils.winapi.Com", MagicMock()), patch.object( + wmi, "WMI", Mock(return_value=WMI) + ), patch.object(WMI, "Win32_ComputerSystem", return_value=[]), patch.object( + WMI, "Win32_OperatingSystem", return_value=[] + ), patch.object( + WMI, "Win32_BIOS", return_value=[] + ), patch.object( + WMI, "Win32_TimeZone", return_value=[] + ), patch.object( + WMI, "Win32_ComputerSystemProduct", return_value=mock + ), patch.object( + WMI, "Win32_BaseBoard", return_value=[] + ), patch( + "platform.version", return_value=platform_version + ), patch( + "salt.utils.win_osinfo.get_join_info", return_value=os_version_info ): result = core._windows_platform_data() assert result["uuid"] == "4c4c4544-0043-4610-8030-c2c04f483033" @@ -206,17 +236,22 @@ def test__windows_platform_data_baseboard(): WMI = Mock() platform_version = "1.2.3" os_version_info = {"Domain": "test", "DomainType": "test_type"} - with ( - patch("salt.utils.winapi.Com", MagicMock()), - patch.object(wmi, "WMI", Mock(return_value=WMI)), - patch.object(WMI, "Win32_ComputerSystem", return_value=[]), - patch.object(WMI, "Win32_OperatingSystem", return_value=[]), - patch.object(WMI, "Win32_BIOS", return_value=[]), - patch.object(WMI, "Win32_TimeZone", return_value=[]), - patch.object(WMI, "Win32_ComputerSystemProduct", return_value=[]), - patch.object(WMI, "Win32_BaseBoard", return_value=mock), - patch("platform.version", return_value=platform_version), - patch("salt.utils.win_osinfo.get_join_info", return_value=os_version_info), + with patch("salt.utils.winapi.Com", MagicMock()), patch.object( + wmi, "WMI", Mock(return_value=WMI) + ), patch.object(WMI, "Win32_ComputerSystem", return_value=[]), patch.object( + WMI, "Win32_OperatingSystem", return_value=[] + ), patch.object( + WMI, "Win32_BIOS", return_value=[] + ), patch.object( + WMI, "Win32_TimeZone", return_value=[] + ), patch.object( + WMI, "Win32_ComputerSystemProduct", return_value=[] + ), patch.object( + WMI, "Win32_BaseBoard", return_value=mock + ), patch( + "platform.version", return_value=platform_version + ), patch( + "salt.utils.win_osinfo.get_join_info", return_value=os_version_info ): result = core._windows_platform_data() assert result["motherboard"]["productname"] == "002KVM" From b8c6c591172fc60b1cc1200ed9d213e4d0a12e9b Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sat, 17 Feb 2024 15:16:46 -0700 Subject: [PATCH 84/96] Bump relenv version to 0.15.0 --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/nightly.yml | 8 ++++---- .github/workflows/scheduled.yml | 8 ++++---- .github/workflows/staging.yml | 8 ++++---- cicd/shared-gh-workflows-context.yml | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26ab7dbbfe5..b2e305e384a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -427,7 +427,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" build-salt-onedir: @@ -443,7 +443,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" build-pkgs-onedir: @@ -456,7 +456,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" source: "onedir" @@ -470,7 +470,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" source: "src" build-ci-deps: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 7ab0f53bc32..de3967a7a69 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -476,7 +476,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" build-salt-onedir: @@ -492,7 +492,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" build-pkgs-onedir: @@ -505,7 +505,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" source: "onedir" environment: nightly @@ -523,7 +523,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" source: "src" environment: nightly diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index ce1e1420a96..b446f1df735 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -461,7 +461,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" build-salt-onedir: @@ -477,7 +477,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" build-pkgs-onedir: @@ -490,7 +490,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" source: "onedir" @@ -504,7 +504,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" source: "src" build-ci-deps: diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 97673dfb1ec..ee9b3da7b3d 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -466,7 +466,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" build-salt-onedir: @@ -482,7 +482,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" build-pkgs-onedir: @@ -495,7 +495,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" source: "onedir" environment: staging @@ -513,7 +513,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.14.2" + relenv-version: "0.15.0" python-version: "3.10.13" source: "src" environment: staging diff --git a/cicd/shared-gh-workflows-context.yml b/cicd/shared-gh-workflows-context.yml index c2691494b37..07cb0f30b9a 100644 --- a/cicd/shared-gh-workflows-context.yml +++ b/cicd/shared-gh-workflows-context.yml @@ -1,3 +1,3 @@ nox_version: "2022.8.7" python_version: "3.10.13" -relenv_version: "0.14.2" +relenv_version: "0.15.0" From 507f727106d5a2ae7c805d348417c19cbcd12c8a Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sat, 17 Feb 2024 15:19:53 -0700 Subject: [PATCH 85/96] Add changelog for salt-pip fix --- changelog/65433.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/65433.fixed.md diff --git a/changelog/65433.fixed.md b/changelog/65433.fixed.md new file mode 100644 index 00000000000..97dd474d15c --- /dev/null +++ b/changelog/65433.fixed.md @@ -0,0 +1 @@ +Upgrade relenv to 0.15.0 to fix namespaced packages installed by salt-pip From 96bd2b2b9bd804ea30fd414f172dd1fb9c6d9381 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sun, 18 Feb 2024 21:10:42 -0700 Subject: [PATCH 86/96] Upgrade to relenv 0.15.1 --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/nightly.yml | 8 ++++---- .github/workflows/scheduled.yml | 8 ++++---- .github/workflows/staging.yml | 8 ++++---- changelog/66094.fixed.md | 1 + cicd/shared-gh-workflows-context.yml | 2 +- 6 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 changelog/66094.fixed.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2e305e384a..c54b0f60f46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -427,7 +427,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" build-salt-onedir: @@ -443,7 +443,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" build-pkgs-onedir: @@ -456,7 +456,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" source: "onedir" @@ -470,7 +470,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" source: "src" build-ci-deps: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index de3967a7a69..43d52e2b3b4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -476,7 +476,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" build-salt-onedir: @@ -492,7 +492,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" build-pkgs-onedir: @@ -505,7 +505,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" source: "onedir" environment: nightly @@ -523,7 +523,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" source: "src" environment: nightly diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index b446f1df735..1618dc54ab9 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -461,7 +461,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" build-salt-onedir: @@ -477,7 +477,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" build-pkgs-onedir: @@ -490,7 +490,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" source: "onedir" @@ -504,7 +504,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" source: "src" build-ci-deps: diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index ee9b3da7b3d..35f20fe6e6e 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -466,7 +466,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" build-salt-onedir: @@ -482,7 +482,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" build-pkgs-onedir: @@ -495,7 +495,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" source: "onedir" environment: staging @@ -513,7 +513,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }} - relenv-version: "0.15.0" + relenv-version: "0.15.1" python-version: "3.10.13" source: "src" environment: staging diff --git a/changelog/66094.fixed.md b/changelog/66094.fixed.md new file mode 100644 index 00000000000..224440f534b --- /dev/null +++ b/changelog/66094.fixed.md @@ -0,0 +1 @@ +Upgrade relenv to 0.15.1 to fix debugpy support. diff --git a/cicd/shared-gh-workflows-context.yml b/cicd/shared-gh-workflows-context.yml index 07cb0f30b9a..42dc9883c7c 100644 --- a/cicd/shared-gh-workflows-context.yml +++ b/cicd/shared-gh-workflows-context.yml @@ -1,3 +1,3 @@ nox_version: "2022.8.7" python_version: "3.10.13" -relenv_version: "0.15.0" +relenv_version: "0.15.1" From 66d8a33c88e5d62a3e9f8759a61fcae909e826a5 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 19 Feb 2024 22:50:37 -0700 Subject: [PATCH 87/96] Fix ssh tests --- salt/loader/__init__.py | 10 ++++++++-- tests/conftest.py | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/salt/loader/__init__.py b/salt/loader/__init__.py index 6bee7e55692..160fe8e60d0 100644 --- a/salt/loader/__init__.py +++ b/salt/loader/__init__.py @@ -890,7 +890,9 @@ def log_handlers(opts, loaded_base_name=None): return FilterDictWrapper(ret, ".setup_handlers") -def ssh_wrapper(opts, functions=None, context=None, loaded_base_name=None): +def ssh_wrapper( + opts, functions=None, context=None, file_client=None, loaded_base_name=None +): """ Returns the custom logging handler modules @@ -908,7 +910,11 @@ def ssh_wrapper(opts, functions=None, context=None, loaded_base_name=None): ), opts, tag="wrapper", - pack={"__salt__": functions, "__context__": context}, + pack={ + "__salt__": functions, + "__context__": context, + "__file_client__": file_client, + }, loaded_base_name=loaded_base_name, ) diff --git a/tests/conftest.py b/tests/conftest.py index fbadf272263..b25db4172e8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -23,7 +23,6 @@ import salt import salt._logging import salt._logging.mixins import salt.config -import salt.loader import salt.utils.files import salt.utils.path import salt.utils.platform From 736ae6c79e2f80a576328352f1743792508f3a5a Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 19 Feb 2024 22:50:37 -0700 Subject: [PATCH 88/96] Fix ssh tests --- salt/loader/__init__.py | 10 ++++++++-- tests/conftest.py | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/salt/loader/__init__.py b/salt/loader/__init__.py index f2e6d1529df..388742589a6 100644 --- a/salt/loader/__init__.py +++ b/salt/loader/__init__.py @@ -890,7 +890,9 @@ def log_handlers(opts, loaded_base_name=None): return FilterDictWrapper(ret, ".setup_handlers") -def ssh_wrapper(opts, functions=None, context=None, loaded_base_name=None): +def ssh_wrapper( + opts, functions=None, context=None, file_client=None, loaded_base_name=None +): """ Returns the custom logging handler modules @@ -908,7 +910,11 @@ def ssh_wrapper(opts, functions=None, context=None, loaded_base_name=None): ), opts, tag="wrapper", - pack={"__salt__": functions, "__context__": context}, + pack={ + "__salt__": functions, + "__context__": context, + "__file_client__": file_client, + }, loaded_base_name=loaded_base_name, ) diff --git a/tests/conftest.py b/tests/conftest.py index 5f79f67e8d6..b6adab5401d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -23,7 +23,6 @@ import salt import salt._logging import salt._logging.mixins import salt.config -import salt.loader import salt.utils.files import salt.utils.path import salt.utils.platform From ba52813f7d52723a5a9ed6f51c59dbd2c5196401 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 20 Feb 2024 18:17:58 +0000 Subject: [PATCH 89/96] Switch hooks to the Saltstack ORG --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0f926d986d5..555b1cec34c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,7 +45,7 @@ repos: salt/ext/.* )$ - - repo: https://github.com/s0undt3ch/python-tools-scripts + - repo: https://github.com/saltstack/python-tools-scripts rev: "0.18.6" hooks: - id: tools @@ -1658,7 +1658,7 @@ repos: hooks: - id: remove-import-headers - - repo: https://github.com/s0undt3ch/salt-rewrite + - repo: https://github.com/saltstack/salt-rewrite # Automatically rewrite code with known rules rev: 2.4.4 hooks: From ce9d09bc9c8f48d588529177023b19f11f47ef1a Mon Sep 17 00:00:00 2001 From: Salt Project Packaging Date: Tue, 20 Feb 2024 22:04:07 +0000 Subject: [PATCH 90/96] Release v3006.7 --- CHANGELOG.md | 55 ++ changelog/34658.fixed.md | 3 - changelog/52289.fixed.md | 1 - changelog/63063.fixed.md | 1 - changelog/65018.fixed.md | 1 - changelog/65154.fixed.md | 2 - changelog/65193.fixed.md | 2 - changelog/65433.fixed.md | 1 - changelog/65450.fixed.md | 1 - changelog/65589.fixed.md | 1 - changelog/65670.fixed.md | 1 - changelog/65691.fixed.md | 1 - changelog/65692.fixed.md | 1 - changelog/65727.fixed.md | 1 - changelog/65752.fixed.md | 1 - changelog/65777.fixed.md | 1 - changelog/65824.fixed.md | 1 - changelog/65932.fixed.md | 1 - changelog/65938.changed.md | 1 - changelog/65951.deprecated.md | 1 - changelog/65954.fixed.md | 1 - changelog/65987.fixed.md | 1 - changelog/65990.fixed.md | 2 - changelog/66004.security.md | 3 - changelog/66006.fixed.md | 1 - changelog/66041.fixed.md | 1 - changelog/66061.fixed.md | 2 - changelog/66090.security.md | 1 - changelog/66094.fixed.md | 1 - doc/man/salt-api.1 | 2 +- doc/man/salt-call.1 | 2 +- doc/man/salt-cloud.1 | 2 +- doc/man/salt-cp.1 | 2 +- doc/man/salt-key.1 | 2 +- doc/man/salt-master.1 | 2 +- doc/man/salt-minion.1 | 2 +- doc/man/salt-proxy.1 | 2 +- doc/man/salt-run.1 | 2 +- doc/man/salt-ssh.1 | 2 +- doc/man/salt-syndic.1 | 2 +- doc/man/salt.1 | 2 +- doc/man/salt.7 | 643 +++++++++++++++--- doc/man/spm.1 | 2 +- doc/topics/releases/3006.7.md | 70 ++ .../releases/templates/3006.7.md.template | 14 + pkg/debian/changelog | 54 ++ pkg/rpm/salt.spec | 53 +- 47 files changed, 815 insertions(+), 136 deletions(-) delete mode 100644 changelog/34658.fixed.md delete mode 100644 changelog/52289.fixed.md delete mode 100644 changelog/63063.fixed.md delete mode 100644 changelog/65018.fixed.md delete mode 100644 changelog/65154.fixed.md delete mode 100644 changelog/65193.fixed.md delete mode 100644 changelog/65433.fixed.md delete mode 100644 changelog/65450.fixed.md delete mode 100644 changelog/65589.fixed.md delete mode 100644 changelog/65670.fixed.md delete mode 100644 changelog/65691.fixed.md delete mode 100644 changelog/65692.fixed.md delete mode 100644 changelog/65727.fixed.md delete mode 100644 changelog/65752.fixed.md delete mode 100644 changelog/65777.fixed.md delete mode 100644 changelog/65824.fixed.md delete mode 100644 changelog/65932.fixed.md delete mode 100644 changelog/65938.changed.md delete mode 100644 changelog/65951.deprecated.md delete mode 100644 changelog/65954.fixed.md delete mode 100644 changelog/65987.fixed.md delete mode 100644 changelog/65990.fixed.md delete mode 100644 changelog/66004.security.md delete mode 100644 changelog/66006.fixed.md delete mode 100644 changelog/66041.fixed.md delete mode 100644 changelog/66061.fixed.md delete mode 100644 changelog/66090.security.md delete mode 100644 changelog/66094.fixed.md create mode 100644 doc/topics/releases/3006.7.md create mode 100644 doc/topics/releases/templates/3006.7.md.template diff --git a/CHANGELOG.md b/CHANGELOG.md index 485b7f77f46..2957e513df8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,61 @@ Versions are `MAJOR.PATCH`. # Changelog +## 3006.7 (2024-02-20) + + +### Deprecated + +- Deprecate and stop using ``salt.features`` [#65951](https://github.com/saltstack/salt/issues/65951) + + +### Changed + +- Change module search path priority, so Salt extensions can be overridden by syncable modules and module_dirs. You can switch back to the old logic by setting features.enable_deprecated_module_search_path_priority to true, but it will be removed in Salt 3008. [#65938](https://github.com/saltstack/salt/issues/65938) + + +### Fixed + +- Fix an issue with mac_shadow that was causing a command execution error when + retrieving values that were not yet set. For example, retrieving last login + before the user had logged in. [#34658](https://github.com/saltstack/salt/issues/34658) +- Fixed an issue when keys didn't match because of line endings [#52289](https://github.com/saltstack/salt/issues/52289) +- Corrected encoding of credentials for use with Artifactory [#63063](https://github.com/saltstack/salt/issues/63063) +- Use `send_multipart` instead of `send` when sending multipart message. [#65018](https://github.com/saltstack/salt/issues/65018) +- Fix an issue where the minion would crash on Windows if some of the grains + failed to resolve [#65154](https://github.com/saltstack/salt/issues/65154) +- Fix issue with openscap when the error was outside the expected scope. It now + returns failed with the error code and the error [#65193](https://github.com/saltstack/salt/issues/65193) +- Upgrade relenv to 0.15.0 to fix namespaced packages installed by salt-pip [#65433](https://github.com/saltstack/salt/issues/65433) +- Fix regression of fileclient re-use when rendering sls pillars and states [#65450](https://github.com/saltstack/salt/issues/65450) +- Fixes the s3fs backend computing the local cache's files with the wrong hash type [#65589](https://github.com/saltstack/salt/issues/65589) +- Fixed Salt-SSH pillar rendering and state rendering with nested SSH calls when called via saltutil.cmd or in an orchestration [#65670](https://github.com/saltstack/salt/issues/65670) +- Fix boto execution module loading [#65691](https://github.com/saltstack/salt/issues/65691) +- Removed PR 65185 changes since incomplete solution [#65692](https://github.com/saltstack/salt/issues/65692) +- catch only ret/ events not all returning events. [#65727](https://github.com/saltstack/salt/issues/65727) +- Fix nonsensical time in fileclient timeout error. [#65752](https://github.com/saltstack/salt/issues/65752) +- Fixes an issue when reading/modifying ini files that contain unicode characters [#65777](https://github.com/saltstack/salt/issues/65777) +- added https proxy to the list of proxies so that requests knows what to do with https based proxies [#65824](https://github.com/saltstack/salt/issues/65824) +- Ensure minion channels are closed on any master connection error. [#65932](https://github.com/saltstack/salt/issues/65932) +- Fixed issue where Salt can't find libcrypto when pip installed from a cloned repo [#65954](https://github.com/saltstack/salt/issues/65954) +- Fix RPM package systemd scriptlets to make RPM packages more universal [#65987](https://github.com/saltstack/salt/issues/65987) +- Fixed an issue where fileclient requests during Pillar rendering cause + fileserver backends to be needlessly refreshed. [#65990](https://github.com/saltstack/salt/issues/65990) +- Fix exceptions being set on futures that are already done in ZeroMQ transport [#66006](https://github.com/saltstack/salt/issues/66006) +- Use hmac compare_digest method in hashutil module to mitigate potential timing attacks [#66041](https://github.com/saltstack/salt/issues/66041) +- Fix request channel default timeout regression. In 3006.5 it was changed from + 60 to 30 and is now set back to 60 by default. [#66061](https://github.com/saltstack/salt/issues/66061) +- Upgrade relenv to 0.15.1 to fix debugpy support. [#66094](https://github.com/saltstack/salt/issues/66094) + + +### Security + +- Bump to ``cryptography==42.0.0`` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f + + In the process, we were also required to update to ``pyOpenSSL==24.0.0`` [#66004](https://github.com/saltstack/salt/issues/66004) +- Bump to `cryptography==42.0.3` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f [#66090](https://github.com/saltstack/salt/issues/66090) + + ## 3006.6 (2024-01-26) diff --git a/changelog/34658.fixed.md b/changelog/34658.fixed.md deleted file mode 100644 index 1152b41d2df..00000000000 --- a/changelog/34658.fixed.md +++ /dev/null @@ -1,3 +0,0 @@ -Fix an issue with mac_shadow that was causing a command execution error when -retrieving values that were not yet set. For example, retrieving last login -before the user had logged in. diff --git a/changelog/52289.fixed.md b/changelog/52289.fixed.md deleted file mode 100644 index 50d5aaf516a..00000000000 --- a/changelog/52289.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fixed an issue when keys didn't match because of line endings diff --git a/changelog/63063.fixed.md b/changelog/63063.fixed.md deleted file mode 100644 index 6f26fc11abd..00000000000 --- a/changelog/63063.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Corrected encoding of credentials for use with Artifactory diff --git a/changelog/65018.fixed.md b/changelog/65018.fixed.md deleted file mode 100644 index c719aac9f99..00000000000 --- a/changelog/65018.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Use `send_multipart` instead of `send` when sending multipart message. diff --git a/changelog/65154.fixed.md b/changelog/65154.fixed.md deleted file mode 100644 index bbc6d8d7ec5..00000000000 --- a/changelog/65154.fixed.md +++ /dev/null @@ -1,2 +0,0 @@ -Fix an issue where the minion would crash on Windows if some of the grains -failed to resolve diff --git a/changelog/65193.fixed.md b/changelog/65193.fixed.md deleted file mode 100644 index 48a7e76e461..00000000000 --- a/changelog/65193.fixed.md +++ /dev/null @@ -1,2 +0,0 @@ -Fix issue with openscap when the error was outside the expected scope. It now -returns failed with the error code and the error diff --git a/changelog/65433.fixed.md b/changelog/65433.fixed.md deleted file mode 100644 index 97dd474d15c..00000000000 --- a/changelog/65433.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Upgrade relenv to 0.15.0 to fix namespaced packages installed by salt-pip diff --git a/changelog/65450.fixed.md b/changelog/65450.fixed.md deleted file mode 100644 index 5847b07145c..00000000000 --- a/changelog/65450.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix regression of fileclient re-use when rendering sls pillars and states diff --git a/changelog/65589.fixed.md b/changelog/65589.fixed.md deleted file mode 100644 index e6f8f40e341..00000000000 --- a/changelog/65589.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fixes the s3fs backend computing the local cache's files with the wrong hash type diff --git a/changelog/65670.fixed.md b/changelog/65670.fixed.md deleted file mode 100644 index 54728d69d43..00000000000 --- a/changelog/65670.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fixed Salt-SSH pillar rendering and state rendering with nested SSH calls when called via saltutil.cmd or in an orchestration diff --git a/changelog/65691.fixed.md b/changelog/65691.fixed.md deleted file mode 100644 index 3b5192f80c0..00000000000 --- a/changelog/65691.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix boto execution module loading diff --git a/changelog/65692.fixed.md b/changelog/65692.fixed.md deleted file mode 100644 index b4eef6c93d4..00000000000 --- a/changelog/65692.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Removed PR 65185 changes since incomplete solution diff --git a/changelog/65727.fixed.md b/changelog/65727.fixed.md deleted file mode 100644 index fe507ce4f8c..00000000000 --- a/changelog/65727.fixed.md +++ /dev/null @@ -1 +0,0 @@ -catch only ret/ events not all returning events. diff --git a/changelog/65752.fixed.md b/changelog/65752.fixed.md deleted file mode 100644 index f611c5e65ec..00000000000 --- a/changelog/65752.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix nonsensical time in fileclient timeout error. diff --git a/changelog/65777.fixed.md b/changelog/65777.fixed.md deleted file mode 100644 index 3427b468878..00000000000 --- a/changelog/65777.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fixes an issue when reading/modifying ini files that contain unicode characters diff --git a/changelog/65824.fixed.md b/changelog/65824.fixed.md deleted file mode 100644 index 213f3f505fb..00000000000 --- a/changelog/65824.fixed.md +++ /dev/null @@ -1 +0,0 @@ -added https proxy to the list of proxies so that requests knows what to do with https based proxies diff --git a/changelog/65932.fixed.md b/changelog/65932.fixed.md deleted file mode 100644 index cafb2bb0022..00000000000 --- a/changelog/65932.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Ensure minion channels are closed on any master connection error. diff --git a/changelog/65938.changed.md b/changelog/65938.changed.md deleted file mode 100644 index a96e39b485d..00000000000 --- a/changelog/65938.changed.md +++ /dev/null @@ -1 +0,0 @@ -Change module search path priority, so Salt extensions can be overridden by syncable modules and module_dirs. You can switch back to the old logic by setting features.enable_deprecated_module_search_path_priority to true, but it will be removed in Salt 3008. diff --git a/changelog/65951.deprecated.md b/changelog/65951.deprecated.md deleted file mode 100644 index 833f9bf478d..00000000000 --- a/changelog/65951.deprecated.md +++ /dev/null @@ -1 +0,0 @@ -Deprecate and stop using ``salt.features`` diff --git a/changelog/65954.fixed.md b/changelog/65954.fixed.md deleted file mode 100644 index 113d603e005..00000000000 --- a/changelog/65954.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fixed issue where Salt can't find libcrypto when pip installed from a cloned repo diff --git a/changelog/65987.fixed.md b/changelog/65987.fixed.md deleted file mode 100644 index 0a5fdff03d2..00000000000 --- a/changelog/65987.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix RPM package systemd scriptlets to make RPM packages more universal diff --git a/changelog/65990.fixed.md b/changelog/65990.fixed.md deleted file mode 100644 index 32027d2afc3..00000000000 --- a/changelog/65990.fixed.md +++ /dev/null @@ -1,2 +0,0 @@ -Fixed an issue where fileclient requests during Pillar rendering cause -fileserver backends to be needlessly refreshed. diff --git a/changelog/66004.security.md b/changelog/66004.security.md deleted file mode 100644 index 111cdc6136a..00000000000 --- a/changelog/66004.security.md +++ /dev/null @@ -1,3 +0,0 @@ -Bump to ``cryptography==42.0.0`` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f - -In the process, we were also required to update to ``pyOpenSSL==24.0.0`` diff --git a/changelog/66006.fixed.md b/changelog/66006.fixed.md deleted file mode 100644 index aa05c9c19af..00000000000 --- a/changelog/66006.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Fix exceptions being set on futures that are already done in ZeroMQ transport diff --git a/changelog/66041.fixed.md b/changelog/66041.fixed.md deleted file mode 100644 index 7f099a8d8e1..00000000000 --- a/changelog/66041.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Use hmac compare_digest method in hashutil module to mitigate potential timing attacks diff --git a/changelog/66061.fixed.md b/changelog/66061.fixed.md deleted file mode 100644 index 1735b25b2a4..00000000000 --- a/changelog/66061.fixed.md +++ /dev/null @@ -1,2 +0,0 @@ -Fix request channel default timeout regression. In 3006.5 it was changed from -60 to 30 and is now set back to 60 by default. diff --git a/changelog/66090.security.md b/changelog/66090.security.md deleted file mode 100644 index 2082ab1778f..00000000000 --- a/changelog/66090.security.md +++ /dev/null @@ -1 +0,0 @@ -Bump to `cryptography==42.0.3` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f diff --git a/changelog/66094.fixed.md b/changelog/66094.fixed.md deleted file mode 100644 index 224440f534b..00000000000 --- a/changelog/66094.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Upgrade relenv to 0.15.1 to fix debugpy support. diff --git a/doc/man/salt-api.1 b/doc/man/salt-api.1 index ef5fc5ed68c..f82b64a4acf 100644 --- a/doc/man/salt-api.1 +++ b/doc/man/salt-api.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT-API" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT-API" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt-api \- salt-api Command .sp diff --git a/doc/man/salt-call.1 b/doc/man/salt-call.1 index 5854684c3ce..01a8c6c5900 100644 --- a/doc/man/salt-call.1 +++ b/doc/man/salt-call.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT-CALL" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT-CALL" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt-call \- salt-call Documentation .SH SYNOPSIS diff --git a/doc/man/salt-cloud.1 b/doc/man/salt-cloud.1 index 75365f7ea89..e2c57db40fc 100644 --- a/doc/man/salt-cloud.1 +++ b/doc/man/salt-cloud.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT-CLOUD" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT-CLOUD" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt-cloud \- Salt Cloud Command .sp diff --git a/doc/man/salt-cp.1 b/doc/man/salt-cp.1 index f0bc77a539c..bbd76b69121 100644 --- a/doc/man/salt-cp.1 +++ b/doc/man/salt-cp.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT-CP" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT-CP" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt-cp \- salt-cp Documentation .sp diff --git a/doc/man/salt-key.1 b/doc/man/salt-key.1 index 35b6d1aa3d3..c6de3044097 100644 --- a/doc/man/salt-key.1 +++ b/doc/man/salt-key.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT-KEY" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT-KEY" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt-key \- salt-key Documentation .SH SYNOPSIS diff --git a/doc/man/salt-master.1 b/doc/man/salt-master.1 index 2e3e0b5a8de..e7c04e2c15f 100644 --- a/doc/man/salt-master.1 +++ b/doc/man/salt-master.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT-MASTER" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT-MASTER" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt-master \- salt-master Documentation .sp diff --git a/doc/man/salt-minion.1 b/doc/man/salt-minion.1 index 1be877af479..70e2f1879c7 100644 --- a/doc/man/salt-minion.1 +++ b/doc/man/salt-minion.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT-MINION" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT-MINION" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt-minion \- salt-minion Documentation .sp diff --git a/doc/man/salt-proxy.1 b/doc/man/salt-proxy.1 index c7ce2d85acb..93bdd1f6fae 100644 --- a/doc/man/salt-proxy.1 +++ b/doc/man/salt-proxy.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT-PROXY" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT-PROXY" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt-proxy \- salt-proxy Documentation .sp diff --git a/doc/man/salt-run.1 b/doc/man/salt-run.1 index e968134ca1c..5231095e460 100644 --- a/doc/man/salt-run.1 +++ b/doc/man/salt-run.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT-RUN" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT-RUN" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt-run \- salt-run Documentation .sp diff --git a/doc/man/salt-ssh.1 b/doc/man/salt-ssh.1 index 1ea3976ae10..1835a0ba620 100644 --- a/doc/man/salt-ssh.1 +++ b/doc/man/salt-ssh.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT-SSH" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT-SSH" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt-ssh \- salt-ssh Documentation .SH SYNOPSIS diff --git a/doc/man/salt-syndic.1 b/doc/man/salt-syndic.1 index b006b33bbb8..652fbeb0c94 100644 --- a/doc/man/salt-syndic.1 +++ b/doc/man/salt-syndic.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT-SYNDIC" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT-SYNDIC" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt-syndic \- salt-syndic Documentation .sp diff --git a/doc/man/salt.1 b/doc/man/salt.1 index 9197a01fd3f..5faa32466d7 100644 --- a/doc/man/salt.1 +++ b/doc/man/salt.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt \- salt .SH SYNOPSIS diff --git a/doc/man/salt.7 b/doc/man/salt.7 index 88d600d0fcc..108bbdf6bf4 100644 --- a/doc/man/salt.7 +++ b/doc/man/salt.7 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SALT" "7" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SALT" "7" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME salt \- Salt Documentation .SH SALT PROJECT @@ -725,7 +725,7 @@ version of Python: .sp .nf .ft C -pyenv install 3.7.0 +pyenv install 3.9.18 .ft P .fi .UNINDENT @@ -742,7 +742,7 @@ new virtual environment with this command: .sp .nf .ft C -pyenv virtualenv 3.7.0 salt +pyenv virtualenv 3.9.18 salt .ft P .fi .UNINDENT @@ -1016,8 +1016,8 @@ you\(aqll need to run 3.9 or earlier. For example: .sp .nf .ft C -pyenv install 3.7.15 -pyenv virtualenv 3.7.15 salt\-docs +pyenv install 3.9.18 +pyenv virtualenv 3.9.18 salt\-docs echo \(aqsalt\-docs\(aq > .python\-version .ft P .fi @@ -1256,7 +1256,7 @@ meaningful and complete! \fITypically\fP the best tests for Salt are going to be unit tests. Testing is \fI\%a whole topic on its own\fP, But you may also want to write functional or integration tests. You\(aqll -find those in the \fBsalt/tests\fP directory. +find those in the \fBtests/\fP directory. .sp When you\(aqre thinking about tests to write, the most important thing to keep in mind is, “What, exactly, am I testing?” When a test fails, you @@ -1558,6 +1558,133 @@ For this, you would be able to install with: .fi .UNINDENT .UNINDENT +.SH SALT PROJECT MAINTENANCE POLICIES +.sp +This document explains the current project maintenance policies. The goal of +these policies are to reduce the maintenance burden on core maintainers of the +Salt Project and to encourage more active engagement from the Salt community. +.INDENT 0.0 +.IP \(bu 2 +\fI\%Issue management\fP +.IP \(bu 2 +\fI\%Pull request management\fP +.IP \(bu 2 +\fI\%Salt Enhancement Proposals (SEP) process\fP +.UNINDENT +.SS Issue management +.sp +Issues for the Salt Project are critical to Salt community communication and to +find and resolve issues in the Salt Project. As such, the issue tracker needs to +be kept clean and current to the currently supported releases of Salt. They also +need to be free of feature requests, arguments, and trolling. +.sp +We have decided to update our issue policy to be similar to RedHat community +project policies. +.sp +Community members who repeatedly violate these policies are subject to bans. +.INDENT 0.0 +.IP 1. 3 +All issues that were not opened against a currently supported release of Salt +will be closed. +.INDENT 3.0 +.IP \(bu 2 +When an old release of Salt is marked out of support, all issues opened +against the now defunct release will be closed. +.IP \(bu 2 +If the issue is still present in the current release of Salt, submit a new +issue. Do not re\-open the old issue after it has been closed. +.IP \(bu 2 +When opening a new issue that was a bug in a previous release of Salt, you +must validate it against a currently supported release of Salt for +consideration. Issues that do not show the problem against a current +release will be closed without consideration. +.UNINDENT +.IP 2. 3 +Only defects can be submitted to the issue tracker. +.INDENT 3.0 +.IP \(bu 2 +Feature requests without a PR will be immediately closed. +.IP \(bu 2 +Feature requests must be designated as a feature being developed and owned +by the issue submitter and assigned to a release. Otherwise they will be +immediately closed. +.IP \(bu 2 +Discussions about features can be held in the GitHub +\fI\%Discussions\fP tab or in +the community \fI\%Open Hour\fP\&. +.IP \(bu 2 +Questions will be immediately closed. +.UNINDENT +.IP 3. 3 +Issues must submit sufficient information. +.INDENT 3.0 +.IP \(bu 2 +Issues must follow the relevant template for information. +.IP \(bu 2 +Issues that do not give sufficient information about the nature of the +issue \fBand how to reproduce the issue\fP will be immediately closed. +.IP \(bu 2 +Issues that do not comply will be immediately closed. +.UNINDENT +.UNINDENT +.SS Pull request management +.sp +The Salt pull request (PR) queue has been a challenge to maintain for the entire +life of the project. This is in large part due to the incredibly active and +vibrant community around Salt. +.sp +Unfortunately, it has proven to be too much for the core team and the greater +Salt community to manage. As such, we deem it necessary to make fundamental +changes to how we manage the PR queue: +.INDENT 0.0 +.IP 1. 3 +All PRs opened against releases of Salt that are no longer supported will be +closed immediately. +.IP 2. 3 +Closed PRs can be resubmitted, NOT re\-opened. +.IP 3. 3 +PRs need to provide full tests for all of the code affected, regardless of +whether the PR author wrote the code affected. +.IP 4. 3 +PR tests need to be written using the current test mechanism (pytest). +.IP 5. 3 +PRs need to pass tests. +.IP 6. 3 +PRs must NOT increase the overall test time by a noticeable length. +.IP 7. 3 +PRs must NOT add new plugins directly to Salt unless sanctioned by the Salt +core team. New plugins should be made into Salt Extensions. +.IP 8. 3 +PRs that have not been updated due to inactivity will be closed. Inactivity +is determined by a lack of submitter activity for the space of 1 month. +.IP 9. 3 +PR tests should always maintain or increase total code coverage. +.UNINDENT +.SS Salt Enhancement Proposals (SEP) process +.sp +\fBA message from Thomas Hatch, creator of Salt:\fP +.sp +In 2019, we decided to create a community process to discuss and review Salt +Enhancement Proposals (SEPs). Unfortunately, I feel that this process has not +proven to be an effective way to solve the core issues around Salt Enhancements. +Overall, the Salt enhancement process has proven itself to be more of a burden +than an accelerant to Salt stability, security, and progress. As such, I feel +that the current optimal course of action is to shut the process down. +.sp +Instead of the Salt Enhancement Proposal process, we will add a time in the +\fI\%Open Hour\fP for people to present ideas and +concepts to better understand if they are worth their effort to develop. +Extensive documentation around more intrusive or involved enhancements should +be included in pull requests (PRs). Conversations about enhancements can also be +held in the \fI\%Discussions\fP tab +in GitHub. +.sp +By migrating the conversation into the PR process, we ensure that we are only +reviewing viable proposals instead of being burdened with requests that the core +team is expected to fulfill. +.sp +Effective immediately (January 2024), we are archiving and freezing the SEP +repo. .SH INSTALLATION .sp See the \fI\%Salt Install Guide\fP @@ -194368,7 +194495,7 @@ Passes through all the parameters described in the \fI\%utils.http.query function\fP: .INDENT 7.0 .TP -.B salt.utils.http.query(url, method=\(aqGET\(aq, params=None, data=None, data_file=None, header_dict=None, header_list=None, header_file=None, username=None, password=None, auth=None, decode=False, decode_type=\(aqauto\(aq, status=False, headers=False, text=False, cookies=None, cookie_jar=None, cookie_format=\(aqlwp\(aq, persist_session=False, session_cookie_jar=None, data_render=False, data_renderer=None, header_render=False, header_renderer=None, template_dict=None, test=False, test_url=None, node=\(aqminion\(aq, port=80, opts=None, backend=None, ca_bundle=None, verify_ssl=None, cert=None, text_out=None, headers_out=None, decode_out=None, stream=False, streaming_callback=None, header_callback=None, handle=False, agent=\(aqSalt/3006.6\(aq, hide_fields=None, raise_error=True, formdata=False, formdata_fieldname=None, formdata_filename=None, decode_body=True, **kwargs) +.B salt.utils.http.query(url, method=\(aqGET\(aq, params=None, data=None, data_file=None, header_dict=None, header_list=None, header_file=None, username=None, password=None, auth=None, decode=False, decode_type=\(aqauto\(aq, status=False, headers=False, text=False, cookies=None, cookie_jar=None, cookie_format=\(aqlwp\(aq, persist_session=False, session_cookie_jar=None, data_render=False, data_renderer=None, header_render=False, header_renderer=None, template_dict=None, test=False, test_url=None, node=\(aqminion\(aq, port=80, opts=None, backend=None, ca_bundle=None, verify_ssl=None, cert=None, text_out=None, headers_out=None, decode_out=None, stream=False, streaming_callback=None, header_callback=None, handle=False, agent=\(aqSalt/3006.7\(aq, hide_fields=None, raise_error=True, formdata=False, formdata_fieldname=None, formdata_filename=None, decode_body=True, **kwargs) Query a resource, and decode the return data .UNINDENT .INDENT 7.0 @@ -197100,8 +197227,46 @@ all (for example /etc/sysctl.conf) .INDENT 0.0 .TP -.B salt.modules.ini_manage.get_ini(file_name, separator=\(aq=\(aq) -Retrieve whole structure from an ini file and return it as dictionary. +.B salt.modules.ini_manage.get_ini(file_name, separator=\(aq=\(aq, encoding=None) +Retrieve the whole structure from an ini file and return it as a dictionary. +.INDENT 7.0 +.TP +.B Parameters +.INDENT 7.0 +.IP \(bu 2 +\fBfile_name\fP (\fI\%str\fP) \-\- The full path to the ini file. +.IP \(bu 2 +\fBseparator\fP (\fI\%str\fP) \-\- +.sp +The character used to separate keys and values. Standard ini files +use the \(dq=\(dq character. The default is \fB=\fP\&. +.sp +New in version 2016.11.0. + + +.IP \(bu 2 +\fBencoding\fP (\fI\%str\fP) \-\- +.sp +A string value representing encoding of the target ini file. If +\fBNone\fP is passed, it uses the system default which is likely +\fButf\-8\fP\&. Default is \fBNone\fP +.sp +New in version 3006.6. + + +.UNINDENT +.TP +.B Returns +.INDENT 7.0 +.TP +.B A dictionary containing the sections along with the values and +names contained in each section +.UNINDENT + +.TP +.B Return type +\fI\%dict\fP +.UNINDENT .sp API Example: .INDENT 7.0 @@ -197110,9 +197275,8 @@ API Example: .nf .ft C import salt.client -with salt.client.giet_local_client() as sc: - sc.cmd(\(aqtarget\(aq, \(aqini.get_ini\(aq, - [path_to_ini_file]) +with salt.client.get_local_client() as sc: + sc.cmd(\(aqtarget\(aq, \(aqini.get_ini\(aq, [path_to_ini_file]) .ft P .fi .UNINDENT @@ -197132,9 +197296,52 @@ salt \(aq*\(aq ini.get_ini /path/to/ini .UNINDENT .INDENT 0.0 .TP -.B salt.modules.ini_manage.get_option(file_name, section, option, separator=\(aq=\(aq) +.B salt.modules.ini_manage.get_option(file_name, section, option, separator=\(aq=\(aq, encoding=None) Get value of a key from a section in an ini file. Returns \fBNone\fP if no matching key was found. +.INDENT 7.0 +.TP +.B Parameters +.INDENT 7.0 +.IP \(bu 2 +\fBfile_name\fP (\fI\%str\fP) \-\- The full path to the ini file. +.IP \(bu 2 +\fBsection\fP (\fI\%str\fP) \-\- A string value representing the section of the ini that the option +is in. If the option is not in a section, leave this empty. +.IP \(bu 2 +\fBoption\fP (\fI\%str\fP) \-\- A string value representing the option to search for. +.IP \(bu 2 +\fBseparator\fP (\fI\%str\fP) \-\- +.sp +The character used to separate keys and values. Standard ini files +use the \(dq=\(dq character. The default is \fB=\fP\&. +.sp +New in version 2016.11.0. + + +.IP \(bu 2 +\fBencoding\fP (\fI\%str\fP) \-\- +.sp +A string value representing encoding of the target ini file. If +\fBNone\fP is passed, it uses the system default which is likely +\fButf\-8\fP\&. Default is \fBNone\fP +.sp +New in version 3006.6. + + +.UNINDENT +.TP +.B Returns +.INDENT 7.0 +.TP +.B The value as defined in the ini file, or \fBNone\fP if empty or not +found +.UNINDENT + +.TP +.B Return type +\fI\%str\fP +.UNINDENT .sp API Example: .INDENT 7.0 @@ -197144,8 +197351,7 @@ API Example: .ft C import salt.client with salt.client.get_local_client() as sc: - sc.cmd(\(aqtarget\(aq, \(aqini.get_option\(aq, - [path_to_ini_file, section_name, option]) + sc.cmd(\(aqtarget\(aq, \(aqini.get_option\(aq, [path_to_ini_file, section_name, option]) .ft P .fi .UNINDENT @@ -197165,9 +197371,50 @@ salt \(aq*\(aq ini.get_option /path/to/ini section_name option_name .UNINDENT .INDENT 0.0 .TP -.B salt.modules.ini_manage.get_section(file_name, section, separator=\(aq=\(aq) -Retrieve a section from an ini file. Returns the section as dictionary. If +.B salt.modules.ini_manage.get_section(file_name, section, separator=\(aq=\(aq, encoding=None) +Retrieve a section from an ini file. Returns the section as a dictionary. If the section is not found, an empty dictionary is returned. +.INDENT 7.0 +.TP +.B Parameters +.INDENT 7.0 +.IP \(bu 2 +\fBfile_name\fP (\fI\%str\fP) \-\- The full path to the ini file. +.IP \(bu 2 +\fBsection\fP (\fI\%str\fP) \-\- A string value representing name of the section to search for. +.IP \(bu 2 +\fBseparator\fP (\fI\%str\fP) \-\- +.sp +The character used to separate keys and values. Standard ini files +use the \(dq=\(dq character. The default is \fB=\fP\&. +.sp +New in version 2016.11.0. + + +.IP \(bu 2 +\fBencoding\fP (\fI\%str\fP) \-\- +.sp +A string value representing encoding of the target ini file. If +\fBNone\fP is passed, it uses the system default which is likely +\fButf\-8\fP\&. Default is \fBNone\fP +.sp +New in version 3006.6. + + +.UNINDENT +.TP +.B Returns +.INDENT 7.0 +.TP +.B A dictionary containing the names and values of all items in the +section of the ini file. If the section is not found, an empty +dictionary is returned +.UNINDENT + +.TP +.B Return type +\fI\%dict\fP +.UNINDENT .sp API Example: .INDENT 7.0 @@ -197177,8 +197424,7 @@ API Example: .ft C import salt.client with salt.client.get_local_client() as sc: - sc.cmd(\(aqtarget\(aq, \(aqini.get_section\(aq, - [path_to_ini_file, section_name]) + sc.cmd(\(aqtarget\(aq, \(aqini.get_section\(aq, [path_to_ini_file, section_name]) .ft P .fi .UNINDENT @@ -197198,9 +197444,52 @@ salt \(aq*\(aq ini.get_section /path/to/ini section_name .UNINDENT .INDENT 0.0 .TP -.B salt.modules.ini_manage.remove_option(file_name, section, option, separator=\(aq=\(aq) +.B salt.modules.ini_manage.remove_option(file_name, section, option, separator=\(aq=\(aq, encoding=None) Remove a key/value pair from a section in an ini file. Returns the value of the removed key, or \fBNone\fP if nothing was removed. +.INDENT 7.0 +.TP +.B Parameters +.INDENT 7.0 +.IP \(bu 2 +\fBfile_name\fP (\fI\%str\fP) \-\- The full path to the ini file. +.IP \(bu 2 +\fBsection\fP (\fI\%str\fP) \-\- A string value representing the section of the ini that the option +is in. If the option is not in a section, leave this empty. +.IP \(bu 2 +\fBoption\fP (\fI\%str\fP) \-\- A string value representing the option to search for. +.IP \(bu 2 +\fBseparator\fP (\fI\%str\fP) \-\- +.sp +The character used to separate keys and values. Standard ini files +use the \(dq=\(dq character. The default is \fB=\fP\&. +.sp +New in version 2016.11.0. + + +.IP \(bu 2 +\fBencoding\fP (\fI\%str\fP) \-\- +.sp +A string value representing encoding of the target ini file. If +\fBNone\fP is passed, it uses the system default which is likely +\fButf\-8\fP\&. Default is \fBNone\fP +.sp +New in version 3006.6. + + +.UNINDENT +.TP +.B Returns +.INDENT 7.0 +.TP +.B A string value representing the option that was removed or \fBNone\fP +if nothing was removed +.UNINDENT + +.TP +.B Return type +\fI\%str\fP +.UNINDENT .sp API Example: .INDENT 7.0 @@ -197210,8 +197499,7 @@ API Example: .ft C import salt sc = salt.client.get_local_client() -sc.cmd(\(aqtarget\(aq, \(aqini.remove_option\(aq, - [path_to_ini_file, section_name, option]) +sc.cmd(\(aqtarget\(aq, \(aqini.remove_option\(aq, [path_to_ini_file, section_name, option]) .ft P .fi .UNINDENT @@ -197231,9 +197519,49 @@ salt \(aq*\(aq ini.remove_option /path/to/ini section_name option_name .UNINDENT .INDENT 0.0 .TP -.B salt.modules.ini_manage.remove_section(file_name, section, separator=\(aq=\(aq) -Remove a section in an ini file. Returns the removed section as dictionary, -or \fBNone\fP if nothing was removed. +.B salt.modules.ini_manage.remove_section(file_name, section, separator=\(aq=\(aq, encoding=None) +Remove a section in an ini file. Returns the removed section as a +dictionary, or \fBNone\fP if nothing is removed. +.INDENT 7.0 +.TP +.B Parameters +.INDENT 7.0 +.IP \(bu 2 +\fBfile_name\fP (\fI\%str\fP) \-\- The full path to the ini file. +.IP \(bu 2 +\fBsection\fP (\fI\%str\fP) \-\- A string value representing the name of the section search for. +.IP \(bu 2 +\fBseparator\fP (\fI\%str\fP) \-\- +.sp +The character used to separate keys and values. Standard ini files +use the \(dq=\(dq character. The default is \fB=\fP\&. +.sp +New in version 2016.11.0. + + +.IP \(bu 2 +\fBencoding\fP (\fI\%str\fP) \-\- +.sp +A string value representing encoding of the target ini file. If +\fBNone\fP is passed, it uses the system default which is likely +\fButf\-8\fP\&. Default is \fBNone\fP +.sp +New in version 3006.6. + + +.UNINDENT +.TP +.B Returns +.INDENT 7.0 +.TP +.B A dictionary containing the names and values of all items in the +section that was removed or \fBNone\fP if nothing was removed +.UNINDENT + +.TP +.B Return type +\fI\%dict\fP +.UNINDENT .sp API Example: .INDENT 7.0 @@ -197243,8 +197571,7 @@ API Example: .ft C import salt.client with salt.client.get_local_client() as sc: - sc.cmd(\(aqtarget\(aq, \(aqini.remove_section\(aq, - [path_to_ini_file, section_name]) + sc.cmd(\(aqtarget\(aq, \(aqini.remove_section\(aq, [path_to_ini_file, section_name]) .ft P .fi .UNINDENT @@ -197264,29 +197591,46 @@ salt \(aq*\(aq ini.remove_section /path/to/ini section_name .UNINDENT .INDENT 0.0 .TP -.B salt.modules.ini_manage.set_option(file_name, sections=None, separator=\(aq=\(aq) +.B salt.modules.ini_manage.set_option(file_name, sections=None, separator=\(aq=\(aq, encoding=None) Edit an ini file, replacing one or more sections. Returns a dictionary containing the changes made. .INDENT 7.0 .TP -.B file_name -path of ini_file -.TP -.B sections -None -A dictionary representing the sections to be edited ini file -The keys are the section names and the values are the dictionary -containing the options -If the ini file does not contain sections the keys and values represent -the options -.TP -.B separator -= -A character used to separate keys and values. Standard ini files use -the \(dq=\(dq character. +.B Parameters +.INDENT 7.0 +.IP \(bu 2 +\fBfile_name\fP (\fI\%str\fP) \-\- The full path to the ini file. +.IP \(bu 2 +\fBsections\fP (\fI\%dict\fP) \-\- A dictionary representing the sections to be edited in the ini file. +The keys are the section names and the values are a dictionary +containing the options. If the ini file does not contain sections +the keys and values represent the options. The default is \fBNone\fP\&. +.IP \(bu 2 +\fBseparator\fP (\fI\%str\fP) \-\- +.sp +The character used to separate keys and values. Standard ini files +use the \(dq=\(dq character. The default is \fB=\fP\&. .sp New in version 2016.11.0. + +.IP \(bu 2 +\fBencoding\fP (\fI\%str\fP) \-\- +.sp +A string value representing encoding of the target ini file. If +\fBNone\fP is passed, it uses the system default which is likely +\fButf\-8\fP\&. Default is \fBNone\fP +.sp +New in version 3006.6. + + +.UNINDENT +.TP +.B Returns +A dictionary representing the changes made to the ini file +.TP +.B Return type +\fI\%dict\fP .UNINDENT .sp API Example: @@ -197298,8 +197642,7 @@ API Example: import salt.client with salt.client.get_local_client() as sc: sc.cmd( - \(aqtarget\(aq, \(aqini.set_option\(aq, - [\(aqpath_to_ini_file\(aq, \(aq{\(dqsection_to_change\(dq: {\(dqkey\(dq: \(dqvalue\(dq}}\(aq] + \(aqtarget\(aq, \(aqini.set_option\(aq, [\(aqpath_to_ini_file\(aq, \(aq{\(dqsection_to_change\(dq: {\(dqkey\(dq: \(dqvalue\(dq}}\(aq] ) .ft P .fi @@ -218197,7 +218540,7 @@ salt \(aq*\(aq assistive.enabled com.smileonmymac.textexpander .UNINDENT .INDENT 0.0 .TP -.B salt.modules.mac_assistive.install(app_id, enable=True) +.B salt.modules.mac_assistive.install(app_id, enable=True, tries=3, wait=10) Install a bundle ID or command as being allowed to use assistive access. .INDENT 7.0 @@ -218207,6 +218550,12 @@ The bundle ID or command to install for assistive access. .TP .B enabled Sets enabled or disabled status. Default is \fBTrue\fP\&. +.TP +.B tries +How many times to try and write to a read\-only tcc. Default is \fBTrue\fP\&. +.TP +.B wait +Number of seconds to wait between tries. Default is \fB10\fP\&. .UNINDENT .sp CLI Example: @@ -219107,7 +219456,7 @@ salt \(aq*\(aq keychain.get_default_keychain .UNINDENT .INDENT 0.0 .TP -.B salt.modules.mac_keychain.get_friendly_name(cert, password) +.B salt.modules.mac_keychain.get_friendly_name(cert, password, legacy=False) Get the friendly name of the given certificate .INDENT 7.0 .TP @@ -219120,6 +219469,9 @@ described for openssl command in the PASS PHRASE ARGUMENTS section .sp Note: The password given here will show up as plaintext in the returned job info. +.TP +.B legacy +Assume legacy format for certificate. .UNINDENT .sp CLI Example: @@ -219129,6 +219481,8 @@ CLI Example: .nf .ft C salt \(aq*\(aq keychain.get_friendly_name /tmp/test.p12 test123 + +salt \(aq*\(aq keychain.get_friendly_name /tmp/test.p12 test123 legacy=True .ft P .fi .UNINDENT @@ -220993,7 +221347,8 @@ Get the date/time the account was created \fBname\fP (\fI\%str\fP) \-\- The username of the account .TP .B Returns -The date/time the account was created (yyyy\-mm\-dd hh:mm:ss) +The date/time the account was created (yyyy\-mm\-dd hh:mm:ss) or 0 if +the value is not defined .TP .B Return type \fI\%str\fP @@ -221086,7 +221441,8 @@ Get the date/time the account was changed \fBname\fP (\fI\%str\fP) \-\- The username of the account .TP .B Returns -The date/time the account was modified (yyyy\-mm\-dd hh:mm:ss) +The date/time the account was modified (yyyy\-mm\-dd hh:mm:ss) or 0 +if the value is not defined .TP .B Return type \fI\%str\fP @@ -221117,10 +221473,11 @@ Get the number of failed login attempts \fBname\fP (\fI\%str\fP) \-\- The username of the account .TP .B Returns -The number of failed login attempts +The number of failed login attempts. 0 may mean there are no failed +login attempts or the value is not defined .TP .B Return type -\fI\%int\fP +\fI\%str\fP .TP .B Raises CommandExecutionError on user not found or any other unknown error @@ -221149,7 +221506,7 @@ Get the date/time of the last failed login attempt .TP .B Returns The date/time of the last failed login attempt on this account -(yyyy\-mm\-dd hh:mm:ss) +(yyyy\-mm\-dd hh:mm:ss) or 0 if the value is not defined .TP .B Return type \fI\%str\fP @@ -291579,7 +291936,8 @@ It exists as a more intuitive way of applying states. .sp APPLYING ALL STATES CONFIGURED IN TOP.SLS (A.K.A. \fI\%HIGHSTATE\fP) .sp -To apply all configured states, simply run \fBstate.apply\fP: +To apply all configured states, simply run \fBstate.apply\fP with no SLS +targets, like so: .INDENT 7.0 .INDENT 3.5 .sp @@ -302346,7 +302704,7 @@ New in version 3004. A transactional system, like \fI\%MicroOS\fP, can present some challenges when the user decided to manage it via Salt. .sp -MicroOS provide a read\-only rootfs and a tool, +MicroOS provides a read\-only rootfs and a tool, \fBtransactional\-update\fP, that takes care of the management of the system (updating, upgrading, installation or reboot, among others) in an atomic way. @@ -302473,7 +302831,7 @@ For example: .sp .nf .ft C -transactional\-update \-\-continue \-\-drop\-if\-no\-change run zypper in apache2\(dq +transactional\-update \-\-continue \-\-drop\-if\-no\-change run zypper in apache2 .ft P .fi .UNINDENT @@ -302591,11 +302949,11 @@ everything can be expressed inside a transaction (for example, restarting a service inside transaction is not allowed). .SS Two step for service restart .sp -In the \fBapache2\(ga example from the beginning we can observe the -biggest drawback. If the package \(ga\(gaapache2\fP is missing, the new +In the \fBapache2\fP example from the beginning we can observe the +biggest drawback. If the package \fBapache2\fP is missing, the new module will create a new transaction, will execute \fBpkg.install\fP inside the transaction (creating the salt\-thin, moving it inside and -delegating the execution to \fItransactional\-update\fP CLI as part of the +delegating the execution to \fBtransactional\-update\fP CLI as part of the full state). Inside the transaction we can do too the required changes in \fB/etc\fP for adding the new \fBvhost\fP, and we can enable the service via systemctl inside the same transaction. @@ -302645,7 +303003,7 @@ this function, check \fIstate.apply_\fP documentation. .TP .B activate_transaction If at the end of the transaction there is a pending activation -(i.e there is a new snaphot in the system), a new reboot will +(i.e there is a new snapshot in the system), a new reboot will be scheduled (default False) .UNINDENT .sp @@ -302707,7 +303065,7 @@ Salt execution module function .TP .B activate_transaction If at the end of the transaction there is a pending activation -(i.e there is a new snaphot in the system), a new reboot will +(i.e there is a new snapshot in the system), a new reboot will be scheduled (default False) .UNINDENT .sp @@ -302877,15 +303235,15 @@ this function, check \fIstate.highstate\fP documentation. .TP .B activate_transaction If at the end of the transaction there is a pending activation -(i.e there is a new snaphot in the system), a new reboot will -be scheduled (default False) +(i.e there is a new snapshot in the system), a new reboot will +be scheduled (Default: False). .TP .B queue Instead of failing immediately when another state run is in progress, queue the new state run to begin running once the other has finished. .sp This option starts a new thread for each queued state run, so use this -option sparingly. (Default: False) +option sparingly (Default: False). .UNINDENT .sp CLI Example: @@ -303245,8 +303603,8 @@ salt microos transactional_update rollback .B salt.modules.transactional_update.run(command, self_update=False, snapshot=None) Run a command in a new snapshot .sp -Execute the command inside a new snapshot. By default this snaphot -will remain, but if \-\-drop\-if\-no\-chage is set, the new snapshot +Execute the command inside a new snapshot. By default this snapshot +will remain, but if \-\-drop\-if\-no\-change is set, the new snapshot will be dropped if there is no change in the file system. .INDENT 7.0 .TP @@ -303289,15 +303647,15 @@ of keyword values is also supported. .TP .B activate_transaction If at the end of the transaction there is a pending activation -(i.e there is a new snaphot in the system), a new reboot will -be scheduled (default False) +(i.e there is a new snapshot in the system), a new reboot will +be scheduled (Default: False). .TP .B queue Instead of failing immediately when another state run is in progress, queue the new state run to begin running once the other has finished. .sp This option starts a new thread for each queued state run, so use this -option sparingly. (Default: False) +option sparingly (Default: False). .UNINDENT .sp CLI Example: @@ -303337,15 +303695,15 @@ may be used to match multiple states. .TP .B activate_transaction If at the end of the transaction there is a pending activation -(i.e there is a new snaphot in the system), a new reboot will -be scheduled (default False) +(i.e there is a new snapshot in the system), a new reboot will +be scheduled (Default: False). .TP .B queue Instead of failing immediately when another state run is in progress, queue the new state run to begin running once the other has finished. .sp This option starts a new thread for each queued state run, so use this -option sparingly. (Default: False) +option sparingly (Default: False). .UNINDENT .sp For a formal description of the possible parameters accepted in @@ -351598,6 +351956,27 @@ More info here: \fI\%https://docs.aws.amazon.com/cli/latest/topic/s3\-config.html\fP .UNINDENT .UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +This fileserver back\-end will by default sync all buckets on every +fileserver update. +.sp +If you want files to be only populated in the cache when requested, you can +disable this in the master config: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +s3.s3_sync_on_update: False +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT .SS salt.fileserver.svnfs .sp Subversion Fileserver Backend @@ -442311,7 +442690,7 @@ This is the top level of the registry. They all begin with HKEY. .IP \(bu 2 HKEY_CLASSES_ROOT (HKCR) .IP \(bu 2 -HKEY_CURRENT_USER(HKCU) +HKEY_CURRENT_USER (HKCU) .IP \(bu 2 HKEY_LOCAL MACHINE (HKLM) .IP \(bu 2 @@ -442393,7 +442772,7 @@ Ensure a registry value is removed. To remove a key use key_absent. A string value representing the full path of the key to include the HIVE, Key, and all Subkeys. For example: .sp -\fBHKEY_LOCAL_MACHINE\e\eSOFTWARE\e\eSalt\fP +\fBHKEY_LOCAL_MACHINE\eSOFTWARE\eSalt\fP .sp Valid hive values include: .INDENT 2.0 @@ -442433,7 +442812,7 @@ CLI Example: .sp .nf .ft C -\(aqHKEY_CURRENT_USER\e\eSOFTWARE\e\eSalt\(aq: +\(aqHKEY_CURRENT_USER\eSOFTWARE\eSalt\(aq: reg.absent \- vname: version .ft P @@ -442536,7 +442915,7 @@ Ensure a registry key or value is present. A string value representing the full path of the key to include the HIVE, Key, and all Subkeys. For example: .sp -\fBHKEY_LOCAL_MACHINE\e\eSOFTWARE\e\eSalt\fP +\fBHKEY_LOCAL_MACHINE\eSOFTWARE\eSalt\fP .sp Valid hive values include: .INDENT 2.0 @@ -442820,14 +443199,14 @@ A dictionary showing the results of the registry operation. Example: .sp The following example will set the \fB(Default)\fP value for the -\fBSOFTWARE\e\eSalt\fP key in the \fBHKEY_CURRENT_USER\fP hive to +\fBSOFTWARE\eSalt\fP key in the \fBHKEY_CURRENT_USER\fP hive to \fB2016.3.1\fP: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C -HKEY_CURRENT_USER\e\eSOFTWARE\e\eSalt: +HKEY_CURRENT_USER\eSOFTWARE\eSalt: reg.present: \- vdata: 2016.3.1 .ft P @@ -442838,14 +443217,14 @@ HKEY_CURRENT_USER\e\eSOFTWARE\e\eSalt: Example: .sp The following example will set the value for the \fBversion\fP entry under -the \fBSOFTWARE\e\eSalt\fP key in the \fBHKEY_CURRENT_USER\fP hive to +the \fBSOFTWARE\eSalt\fP key in the \fBHKEY_CURRENT_USER\fP hive to \fB2016.3.1\fP\&. The value will be reflected in \fBWow6432Node\fP: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C -HKEY_CURRENT_USER\e\eSOFTWARE\e\eSalt: +HKEY_CURRENT_USER\eSOFTWARE\eSalt: reg.present: \- vname: version \- vdata: 2016.3.1 @@ -442861,7 +443240,7 @@ In the above example the path is interpreted as follows: .IP \(bu 2 \fBHKEY_CURRENT_USER\fP is the hive .IP \(bu 2 -\fBSOFTWARE\e\eSalt\fP is the key +\fBSOFTWARE\eSalt\fP is the key .IP \(bu 2 \fBvname\fP is the value name (\(aqversion\(aq) that will be created under the key .IP \(bu 2 @@ -457898,7 +458277,7 @@ installed2 .UNINDENT .INDENT 0.0 .TP -.B salt.states.zcbuildout.installed(name, config=\(aqbuildout.cfg\(aq, quiet=False, parts=None, user=None, env=(), buildout_ver=None, test_release=False, distribute=None, new_st=None, offline=False, newest=False, python=\(aq/opt/actions\-runner/_work/salt\-priv/salt\-priv/.tools\-venvs/py3.10/docs/bin/python\(aq, debug=False, verbose=False, unless=None, onlyif=None, use_vt=False, loglevel=\(aqdebug\(aq, **kwargs) +.B salt.states.zcbuildout.installed(name, config=\(aqbuildout.cfg\(aq, quiet=False, parts=None, user=None, env=(), buildout_ver=None, test_release=False, distribute=None, new_st=None, offline=False, newest=False, python=\(aq/opt/actions\-runner/_work/salt/salt/.tools\-venvs/py3.10/docs/bin/python\(aq, debug=False, verbose=False, unless=None, onlyif=None, use_vt=False, loglevel=\(aqdebug\(aq, **kwargs) Install buildout in a specific directory .sp It is a thin wrapper to modules.buildout.buildout @@ -466917,7 +467296,7 @@ version of Python: .sp .nf .ft C -pyenv install 3.7.0 +pyenv install 3.9.18 .ft P .fi .UNINDENT @@ -466934,7 +467313,7 @@ new virtual environment with this command: .sp .nf .ft C -pyenv virtualenv 3.7.0 salt +pyenv virtualenv 3.9.18 salt .ft P .fi .UNINDENT @@ -467208,8 +467587,8 @@ you\(aqll need to run 3.9 or earlier. For example: .sp .nf .ft C -pyenv install 3.7.15 -pyenv virtualenv 3.7.15 salt\-docs +pyenv install 3.9.18 +pyenv virtualenv 3.9.18 salt\-docs echo \(aqsalt\-docs\(aq > .python\-version .ft P .fi @@ -467448,7 +467827,7 @@ meaningful and complete! \fITypically\fP the best tests for Salt are going to be unit tests. Testing is \fI\%a whole topic on its own\fP, But you may also want to write functional or integration tests. You\(aqll -find those in the \fBsalt/tests\fP directory. +find those in the \fBtests/\fP directory. .sp When you\(aqre thinking about tests to write, the most important thing to keep in mind is, “What, exactly, am I testing?” When a test fails, you @@ -478009,6 +478388,85 @@ Bump to \fBgitpython==3.1.41\fP due to \fI\%https://github.com/advisories/GHSA\- Bump to \fBjinja2==3.1.3\fP due to \fI\%https://github.com/advisories/GHSA\-h5c8\-rqwp\-cp95\fP \fI\%#65830\fP .UNINDENT .UNINDENT +(release\-3006.7)= +.SS Salt 3006.7 release notes +.SS Changelog +.SS Deprecated +.INDENT 0.0 +.IP \(bu 2 +Deprecate and stop using \fBsalt.features\fP \fI\%#65951\fP +.UNINDENT +.SS Changed +.INDENT 0.0 +.IP \(bu 2 +Change module search path priority, so Salt extensions can be overridden by syncable modules and module_dirs. You can switch back to the old logic by setting features.enable_deprecated_module_search_path_priority to true, but it will be removed in Salt 3008. \fI\%#65938\fP +.UNINDENT +.SS Fixed +.INDENT 0.0 +.IP \(bu 2 +Fix an issue with mac_shadow that was causing a command execution error when +retrieving values that were not yet set. For example, retrieving last login +before the user had logged in. \fI\%#34658\fP +.IP \(bu 2 +Fixed an issue when keys didn\(aqt match because of line endings \fI\%#52289\fP +.IP \(bu 2 +Corrected encoding of credentials for use with Artifactory \fI\%#63063\fP +.IP \(bu 2 +Use \fBsend_multipart\fP instead of \fBsend\fP when sending multipart message. \fI\%#65018\fP +.IP \(bu 2 +Fix an issue where the minion would crash on Windows if some of the grains +failed to resolve \fI\%#65154\fP +.IP \(bu 2 +Fix issue with openscap when the error was outside the expected scope. It now +returns failed with the error code and the error \fI\%#65193\fP +.IP \(bu 2 +Upgrade relenv to 0.15.0 to fix namespaced packages installed by salt\-pip \fI\%#65433\fP +.IP \(bu 2 +Fix regression of fileclient re\-use when rendering sls pillars and states \fI\%#65450\fP +.IP \(bu 2 +Fixes the s3fs backend computing the local cache\(aqs files with the wrong hash type \fI\%#65589\fP +.IP \(bu 2 +Fixed Salt\-SSH pillar rendering and state rendering with nested SSH calls when called via saltutil.cmd or in an orchestration \fI\%#65670\fP +.IP \(bu 2 +Fix boto execution module loading \fI\%#65691\fP +.IP \(bu 2 +Removed PR 65185 changes since incomplete solution \fI\%#65692\fP +.IP \(bu 2 +catch only ret/ events not all returning events. \fI\%#65727\fP +.IP \(bu 2 +Fix nonsensical time in fileclient timeout error. \fI\%#65752\fP +.IP \(bu 2 +Fixes an issue when reading/modifying ini files that contain unicode characters \fI\%#65777\fP +.IP \(bu 2 +added https proxy to the list of proxies so that requests knows what to do with https based proxies \fI\%#65824\fP +.IP \(bu 2 +Ensure minion channels are closed on any master connection error. \fI\%#65932\fP +.IP \(bu 2 +Fixed issue where Salt can\(aqt find libcrypto when pip installed from a cloned repo \fI\%#65954\fP +.IP \(bu 2 +Fix RPM package systemd scriptlets to make RPM packages more universal \fI\%#65987\fP +.IP \(bu 2 +Fixed an issue where fileclient requests during Pillar rendering cause +fileserver backends to be needlessly refreshed. \fI\%#65990\fP +.IP \(bu 2 +Fix exceptions being set on futures that are already done in ZeroMQ transport \fI\%#66006\fP +.IP \(bu 2 +Use hmac compare_digest method in hashutil module to mitigate potential timing attacks \fI\%#66041\fP +.IP \(bu 2 +Fix request channel default timeout regression. In 3006.5 it was changed from +60 to 30 and is now set back to 60 by default. \fI\%#66061\fP +.IP \(bu 2 +Upgrade relenv to 0.15.1 to fix debugpy support. \fI\%#66094\fP +.UNINDENT +.SS Security +.INDENT 0.0 +.IP \(bu 2 +Bump to \fBcryptography==42.0.0\fP due to \fI\%https://github.com/advisories/GHSA\-3ww4\-gg4f\-jr7f\fP +.sp +In the process, we were also required to update to \fBpyOpenSSL==24.0.0\fP \fI\%#66004\fP +.IP \(bu 2 +Bump to \fBcryptography==42.0.3\fP due to \fI\%https://github.com/advisories/GHSA\-3ww4\-gg4f\-jr7f\fP \fI\%#66090\fP +.UNINDENT .sp See \fI\%Install a release candidate\fP for more information about installing an RC when one is available. @@ -478998,6 +479456,19 @@ Bump to \fIurllib3==1.26.17\fP or \fIurllib3==2.0.6\fP due to \fI\%https://githu .IP \(bu 2 Bump to \fIgitpython==3.1.37\fP due to \fI\%https://github.com/advisories/GHSA\-cwvm\-v4w8\-q58c\fP (#65383) .UNINDENT +.SS Salt 3005.5 Release Notes +.sp +Version 3005.5 is a CVE security fix release for \fI\%3005\fP\&. +.SS Security +.INDENT 0.0 +.IP \(bu 2 +Fix CVE\-2024\-22231 by preventing directory traversal when creating syndic cache directory on the master. +.IP \(bu 2 +Fix CVE\-2024\-22232 Prevent directory traversal attacks in the master\(aqs serve_file method. +.UNINDENT +.sp +These vulnerablities were discovered and reported by: +Yudi Zhao(Huawei Nebula Security Lab),Chenwei Jiang(Huawei Nebula Security Lab) (#565) .SS Salt 3004 Release Notes \- Codename Silicon .SS New Features .SS Transactional System Support (MicroOS) diff --git a/doc/man/spm.1 b/doc/man/spm.1 index 1930413db07..f9be92b6be5 100644 --- a/doc/man/spm.1 +++ b/doc/man/spm.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "SPM" "1" "Generated on January 26, 2024 at 11:57:28 AM UTC." "3006.6" "Salt" +.TH "SPM" "1" "Generated on February 20, 2024 at 09:55:17 PM UTC." "3006.7" "Salt" .SH NAME spm \- Salt Package Manager Command .sp diff --git a/doc/topics/releases/3006.7.md b/doc/topics/releases/3006.7.md new file mode 100644 index 00000000000..d9776b05eea --- /dev/null +++ b/doc/topics/releases/3006.7.md @@ -0,0 +1,70 @@ +(release-3006.7)= +# Salt 3006.7 release notes + + + + + + + +## Changelog + +### Deprecated + +- Deprecate and stop using ``salt.features`` [#65951](https://github.com/saltstack/salt/issues/65951) + + +### Changed + +- Change module search path priority, so Salt extensions can be overridden by syncable modules and module_dirs. You can switch back to the old logic by setting features.enable_deprecated_module_search_path_priority to true, but it will be removed in Salt 3008. [#65938](https://github.com/saltstack/salt/issues/65938) + + +### Fixed + +- Fix an issue with mac_shadow that was causing a command execution error when + retrieving values that were not yet set. For example, retrieving last login + before the user had logged in. [#34658](https://github.com/saltstack/salt/issues/34658) +- Fixed an issue when keys didn't match because of line endings [#52289](https://github.com/saltstack/salt/issues/52289) +- Corrected encoding of credentials for use with Artifactory [#63063](https://github.com/saltstack/salt/issues/63063) +- Use `send_multipart` instead of `send` when sending multipart message. [#65018](https://github.com/saltstack/salt/issues/65018) +- Fix an issue where the minion would crash on Windows if some of the grains + failed to resolve [#65154](https://github.com/saltstack/salt/issues/65154) +- Fix issue with openscap when the error was outside the expected scope. It now + returns failed with the error code and the error [#65193](https://github.com/saltstack/salt/issues/65193) +- Upgrade relenv to 0.15.0 to fix namespaced packages installed by salt-pip [#65433](https://github.com/saltstack/salt/issues/65433) +- Fix regression of fileclient re-use when rendering sls pillars and states [#65450](https://github.com/saltstack/salt/issues/65450) +- Fixes the s3fs backend computing the local cache's files with the wrong hash type [#65589](https://github.com/saltstack/salt/issues/65589) +- Fixed Salt-SSH pillar rendering and state rendering with nested SSH calls when called via saltutil.cmd or in an orchestration [#65670](https://github.com/saltstack/salt/issues/65670) +- Fix boto execution module loading [#65691](https://github.com/saltstack/salt/issues/65691) +- Removed PR 65185 changes since incomplete solution [#65692](https://github.com/saltstack/salt/issues/65692) +- catch only ret/ events not all returning events. [#65727](https://github.com/saltstack/salt/issues/65727) +- Fix nonsensical time in fileclient timeout error. [#65752](https://github.com/saltstack/salt/issues/65752) +- Fixes an issue when reading/modifying ini files that contain unicode characters [#65777](https://github.com/saltstack/salt/issues/65777) +- added https proxy to the list of proxies so that requests knows what to do with https based proxies [#65824](https://github.com/saltstack/salt/issues/65824) +- Ensure minion channels are closed on any master connection error. [#65932](https://github.com/saltstack/salt/issues/65932) +- Fixed issue where Salt can't find libcrypto when pip installed from a cloned repo [#65954](https://github.com/saltstack/salt/issues/65954) +- Fix RPM package systemd scriptlets to make RPM packages more universal [#65987](https://github.com/saltstack/salt/issues/65987) +- Fixed an issue where fileclient requests during Pillar rendering cause + fileserver backends to be needlessly refreshed. [#65990](https://github.com/saltstack/salt/issues/65990) +- Fix exceptions being set on futures that are already done in ZeroMQ transport [#66006](https://github.com/saltstack/salt/issues/66006) +- Use hmac compare_digest method in hashutil module to mitigate potential timing attacks [#66041](https://github.com/saltstack/salt/issues/66041) +- Fix request channel default timeout regression. In 3006.5 it was changed from + 60 to 30 and is now set back to 60 by default. [#66061](https://github.com/saltstack/salt/issues/66061) +- Upgrade relenv to 0.15.1 to fix debugpy support. [#66094](https://github.com/saltstack/salt/issues/66094) + + +### Security + +- Bump to ``cryptography==42.0.0`` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f + + In the process, we were also required to update to ``pyOpenSSL==24.0.0`` [#66004](https://github.com/saltstack/salt/issues/66004) +- Bump to `cryptography==42.0.3` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f [#66090](https://github.com/saltstack/salt/issues/66090) diff --git a/doc/topics/releases/templates/3006.7.md.template b/doc/topics/releases/templates/3006.7.md.template new file mode 100644 index 00000000000..3740af58042 --- /dev/null +++ b/doc/topics/releases/templates/3006.7.md.template @@ -0,0 +1,14 @@ +(release-3006.7)= +# Salt 3006.7 release notes{{ unreleased }} +{{ warning }} + + + + +## Changelog +{{ changelog }} diff --git a/pkg/debian/changelog b/pkg/debian/changelog index 404ae322134..0ba69f84d07 100644 --- a/pkg/debian/changelog +++ b/pkg/debian/changelog @@ -1,3 +1,57 @@ +salt (3006.7) stable; urgency=medium + + + # Deprecated + + * Deprecate and stop using ``salt.features`` [#65951](https://github.com/saltstack/salt/issues/65951) + + # Changed + + * Change module search path priority, so Salt extensions can be overridden by syncable modules and module_dirs. You can switch back to the old logic by setting features.enable_deprecated_module_search_path_priority to true, but it will be removed in Salt 3008. [#65938](https://github.com/saltstack/salt/issues/65938) + + # Fixed + + * Fix an issue with mac_shadow that was causing a command execution error when + retrieving values that were not yet set. For example, retrieving last login + before the user had logged in. [#34658](https://github.com/saltstack/salt/issues/34658) + * Fixed an issue when keys didn't match because of line endings [#52289](https://github.com/saltstack/salt/issues/52289) + * Corrected encoding of credentials for use with Artifactory [#63063](https://github.com/saltstack/salt/issues/63063) + * Use `send_multipart` instead of `send` when sending multipart message. [#65018](https://github.com/saltstack/salt/issues/65018) + * Fix an issue where the minion would crash on Windows if some of the grains + failed to resolve [#65154](https://github.com/saltstack/salt/issues/65154) + * Fix issue with openscap when the error was outside the expected scope. It now + returns failed with the error code and the error [#65193](https://github.com/saltstack/salt/issues/65193) + * Upgrade relenv to 0.15.0 to fix namespaced packages installed by salt-pip [#65433](https://github.com/saltstack/salt/issues/65433) + * Fix regression of fileclient re-use when rendering sls pillars and states [#65450](https://github.com/saltstack/salt/issues/65450) + * Fixes the s3fs backend computing the local cache's files with the wrong hash type [#65589](https://github.com/saltstack/salt/issues/65589) + * Fixed Salt-SSH pillar rendering and state rendering with nested SSH calls when called via saltutil.cmd or in an orchestration [#65670](https://github.com/saltstack/salt/issues/65670) + * Fix boto execution module loading [#65691](https://github.com/saltstack/salt/issues/65691) + * Removed PR 65185 changes since incomplete solution [#65692](https://github.com/saltstack/salt/issues/65692) + * catch only ret/ events not all returning events. [#65727](https://github.com/saltstack/salt/issues/65727) + * Fix nonsensical time in fileclient timeout error. [#65752](https://github.com/saltstack/salt/issues/65752) + * Fixes an issue when reading/modifying ini files that contain unicode characters [#65777](https://github.com/saltstack/salt/issues/65777) + * added https proxy to the list of proxies so that requests knows what to do with https based proxies [#65824](https://github.com/saltstack/salt/issues/65824) + * Ensure minion channels are closed on any master connection error. [#65932](https://github.com/saltstack/salt/issues/65932) + * Fixed issue where Salt can't find libcrypto when pip installed from a cloned repo [#65954](https://github.com/saltstack/salt/issues/65954) + * Fix RPM package systemd scriptlets to make RPM packages more universal [#65987](https://github.com/saltstack/salt/issues/65987) + * Fixed an issue where fileclient requests during Pillar rendering cause + fileserver backends to be needlessly refreshed. [#65990](https://github.com/saltstack/salt/issues/65990) + * Fix exceptions being set on futures that are already done in ZeroMQ transport [#66006](https://github.com/saltstack/salt/issues/66006) + * Use hmac compare_digest method in hashutil module to mitigate potential timing attacks [#66041](https://github.com/saltstack/salt/issues/66041) + * Fix request channel default timeout regression. In 3006.5 it was changed from + 60 to 30 and is now set back to 60 by default. [#66061](https://github.com/saltstack/salt/issues/66061) + * Upgrade relenv to 0.15.1 to fix debugpy support. [#66094](https://github.com/saltstack/salt/issues/66094) + + # Security + + * Bump to ``cryptography==42.0.0`` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f + + In the process, we were also required to update to ``pyOpenSSL==24.0.0`` [#66004](https://github.com/saltstack/salt/issues/66004) + * Bump to `cryptography==42.0.3` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f [#66090](https://github.com/saltstack/salt/issues/66090) + + + -- Salt Project Packaging Tue, 20 Feb 2024 21:54:35 +0000 + salt (3006.6) stable; urgency=medium diff --git a/pkg/rpm/salt.spec b/pkg/rpm/salt.spec index 4053921d366..2821cfd2f05 100644 --- a/pkg/rpm/salt.spec +++ b/pkg/rpm/salt.spec @@ -31,7 +31,7 @@ %define fish_dir %{_datadir}/fish/vendor_functions.d Name: salt -Version: 3006.6 +Version: 3006.7 Release: 0 Summary: A parallel remote execution system Group: System Environment/Daemons @@ -646,6 +646,57 @@ if [ $1 -ge 1 ] ; then fi %changelog +* Tue Feb 20 2024 Salt Project Packaging - 3006.7 + +# Deprecated + +- Deprecate and stop using ``salt.features`` [#65951](https://github.com/saltstack/salt/issues/65951) + +# Changed + +- Change module search path priority, so Salt extensions can be overridden by syncable modules and module_dirs. You can switch back to the old logic by setting features.enable_deprecated_module_search_path_priority to true, but it will be removed in Salt 3008. [#65938](https://github.com/saltstack/salt/issues/65938) + +# Fixed + +- Fix an issue with mac_shadow that was causing a command execution error when + retrieving values that were not yet set. For example, retrieving last login + before the user had logged in. [#34658](https://github.com/saltstack/salt/issues/34658) +- Fixed an issue when keys didn't match because of line endings [#52289](https://github.com/saltstack/salt/issues/52289) +- Corrected encoding of credentials for use with Artifactory [#63063](https://github.com/saltstack/salt/issues/63063) +- Use `send_multipart` instead of `send` when sending multipart message. [#65018](https://github.com/saltstack/salt/issues/65018) +- Fix an issue where the minion would crash on Windows if some of the grains + failed to resolve [#65154](https://github.com/saltstack/salt/issues/65154) +- Fix issue with openscap when the error was outside the expected scope. It now + returns failed with the error code and the error [#65193](https://github.com/saltstack/salt/issues/65193) +- Upgrade relenv to 0.15.0 to fix namespaced packages installed by salt-pip [#65433](https://github.com/saltstack/salt/issues/65433) +- Fix regression of fileclient re-use when rendering sls pillars and states [#65450](https://github.com/saltstack/salt/issues/65450) +- Fixes the s3fs backend computing the local cache's files with the wrong hash type [#65589](https://github.com/saltstack/salt/issues/65589) +- Fixed Salt-SSH pillar rendering and state rendering with nested SSH calls when called via saltutil.cmd or in an orchestration [#65670](https://github.com/saltstack/salt/issues/65670) +- Fix boto execution module loading [#65691](https://github.com/saltstack/salt/issues/65691) +- Removed PR 65185 changes since incomplete solution [#65692](https://github.com/saltstack/salt/issues/65692) +- catch only ret/ events not all returning events. [#65727](https://github.com/saltstack/salt/issues/65727) +- Fix nonsensical time in fileclient timeout error. [#65752](https://github.com/saltstack/salt/issues/65752) +- Fixes an issue when reading/modifying ini files that contain unicode characters [#65777](https://github.com/saltstack/salt/issues/65777) +- added https proxy to the list of proxies so that requests knows what to do with https based proxies [#65824](https://github.com/saltstack/salt/issues/65824) +- Ensure minion channels are closed on any master connection error. [#65932](https://github.com/saltstack/salt/issues/65932) +- Fixed issue where Salt can't find libcrypto when pip installed from a cloned repo [#65954](https://github.com/saltstack/salt/issues/65954) +- Fix RPM package systemd scriptlets to make RPM packages more universal [#65987](https://github.com/saltstack/salt/issues/65987) +- Fixed an issue where fileclient requests during Pillar rendering cause + fileserver backends to be needlessly refreshed. [#65990](https://github.com/saltstack/salt/issues/65990) +- Fix exceptions being set on futures that are already done in ZeroMQ transport [#66006](https://github.com/saltstack/salt/issues/66006) +- Use hmac compare_digest method in hashutil module to mitigate potential timing attacks [#66041](https://github.com/saltstack/salt/issues/66041) +- Fix request channel default timeout regression. In 3006.5 it was changed from + 60 to 30 and is now set back to 60 by default. [#66061](https://github.com/saltstack/salt/issues/66061) +- Upgrade relenv to 0.15.1 to fix debugpy support. [#66094](https://github.com/saltstack/salt/issues/66094) + +# Security + +- Bump to ``cryptography==42.0.0`` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f + + In the process, we were also required to update to ``pyOpenSSL==24.0.0`` [#66004](https://github.com/saltstack/salt/issues/66004) +- Bump to `cryptography==42.0.3` due to https://github.com/advisories/GHSA-3ww4-gg4f-jr7f [#66090](https://github.com/saltstack/salt/issues/66090) + + * Fri Jan 26 2024 Salt Project Packaging - 3006.6 # Changed From 9a35eb712a942c840c465568d8a2c1c0b8594243 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 27 Feb 2024 02:20:04 -0700 Subject: [PATCH 91/96] Avoid circular imports on mac os --- salt/utils/templates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/salt/utils/templates.py b/salt/utils/templates.py index 7089d66797f..317ccb43460 100644 --- a/salt/utils/templates.py +++ b/salt/utils/templates.py @@ -29,7 +29,6 @@ import salt.utils.yamlencoding from salt import __path__ as saltpath from salt.exceptions import CommandExecutionError, SaltInvocationError, SaltRenderError from salt.loader.context import NamedLoaderContext -from salt.loader.dunder import __file_client__ from salt.utils.decorators.jinja import JinjaFilter, JinjaGlobal, JinjaTest from salt.utils.odict import OrderedDict from salt.utils.versions import Version @@ -358,6 +357,8 @@ def render_jinja_tmpl(tmplstr, context, tmplpath=None): if tmplpath: loader = jinja2.FileSystemLoader(os.path.dirname(tmplpath)) else: + from salt.loader.dunder import __file_client__ + loader = salt.utils.jinja.SaltCacheLoader( opts, saltenv, From 163bab3849b07b6499eca4d1ff1e9031d58236c7 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 27 Feb 2024 14:39:11 -0700 Subject: [PATCH 92/96] Do not choke on non existing path --- salt/utils/path.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/salt/utils/path.py b/salt/utils/path.py index ed4b4a0f35a..3d7fba8dc6e 100644 --- a/salt/utils/path.py +++ b/salt/utils/path.py @@ -207,7 +207,10 @@ def which(exe=None): # iterate through all extensions to see which one is executable for ext in pathext: pext = p + ext - rp = resolve(pext) + try: + rp = resolve(pext) + except OSError as exc: + continue if is_executable(rp): return p + ext continue From bec314d2d7755879ca8a36cbc9a34ed79c199c18 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 27 Feb 2024 14:39:24 -0700 Subject: [PATCH 93/96] Pre-commit formatting updates --- salt/utils/path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/utils/path.py b/salt/utils/path.py index 3d7fba8dc6e..cf3e4cf50bf 100644 --- a/salt/utils/path.py +++ b/salt/utils/path.py @@ -290,7 +290,7 @@ def check_or_die(command): raise CommandNotFoundError("'None' is not a valid command.") if not which(command): - raise CommandNotFoundError("'{}' is not in the path".format(command)) + raise CommandNotFoundError(f"'{command}' is not in the path") def sanitize_win_path(winpath): From 588fb116f79229370d327c71e965d25ff5b435bb Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 27 Feb 2024 14:52:16 -0700 Subject: [PATCH 94/96] Update test timeouts, work around pylint failure --- .../states/test_docker_container.py | 32 +++++++++---------- tests/unit/utils/test_pyobjects.py | 2 +- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/tests/pytests/functional/states/test_docker_container.py b/tests/pytests/functional/states/test_docker_container.py index 2267399891e..3eb8d836406 100644 --- a/tests/pytests/functional/states/test_docker_container.py +++ b/tests/pytests/functional/states/test_docker_container.py @@ -29,6 +29,7 @@ pytestmark = [ pytest.mark.skip_if_binaries_missing( "docker", "dockerd", reason="Docker not installed" ), + pytest.mark.timeout(120), ] IPV6_ENABLED = bool(salt.utils.network.ip_addrs6(include_loopback=True)) @@ -62,7 +63,7 @@ class Network: @ip_arg.default def _ip_arg(self): - return "ipv{}_address".format(self.net.version) + return f"ipv{self.net.version}_address" @enable_ipv6.default def _enable_ipv6(self): @@ -70,12 +71,13 @@ class Network: @staticmethod def arg_map(arg_name): - return { + nwmap = { "ipv4_address": "IPv4Address", "ipv6_address": "IPv6Address", "links": "Links", "aliases": "Aliases", - }[arg_name] + } + return nwmap[arg_name] @property def compressed_subnet(self): @@ -226,7 +228,7 @@ def test_running_with_no_predefined_volume( ret = docker_container.running( name=container_name, image=image, - binds="{}:/foo".format(tmp_path), + binds=f"{tmp_path}:/foo", shutdown_timeout=1, ) assert ret.result is True @@ -566,7 +568,7 @@ def test_absent_with_stopped_container( # Nothing should have changed assert ret.changes == {} # Ensure that the comment field says the container does not exist - assert ret.comment == "Container '{}' does not exist".format(container_name) + assert ret.comment == f"Container '{container_name}' does not exist" @pytest.mark.slow_test @@ -605,7 +607,7 @@ def test_absent_with_running_container(docker_container, container_name, image): # Check that we have a removed container ID in the changes dict assert "removed" in ret.changes # The comment should mention that the container was removed - assert ret.comment == "Forcibly removed container '{}'".format(container_name) + assert ret.comment == f"Forcibly removed container '{container_name}'" @pytest.mark.slow_test @@ -735,7 +737,7 @@ def test_running_networks( ) log.error(msg) log.error("Connected networks: %s", connected_networks) - pytest.fail("{}. See log for more information.".format(msg)) + pytest.fail(f"{msg}. See log for more information.") # Check that container continued running and didn't immediately exit assert inspect_result["State"]["Running"] @@ -758,12 +760,10 @@ def test_running_networks( } assert ret.changes == expected - expected = [ - "Container '{}' is already configured as specified.".format(container_name) - ] + expected = [f"Container '{container_name}' is already configured as specified."] expected.extend( [ - "Reconnected to network '{}' with updated configuration.".format(x.name) + f"Reconnected to network '{x.name}' with updated configuration." for x in sorted(networks.nets, key=lambda y: y.name) ] ) @@ -884,7 +884,7 @@ def test_running_explicit_networks( net_changes = ret.changes["container"]["Networks"] assert ( - "Container '{}' is already configured as specified.".format(container_name) + f"Container '{container_name}' is already configured as specified." in ret.comment ) @@ -893,15 +893,13 @@ def test_running_explicit_networks( ]["Networks"] for default_network in default_networks: - assert ( - "Disconnected from network '{}'.".format(default_network) in ret.comment - ) + assert f"Disconnected from network '{default_network}'." in ret.comment assert default_network in net_changes # We've tested that the state return is correct, but let's be extra # paranoid and check the actual connected networks. assert default_network not in updated_networks - assert "Connected to network '{}'.".format(net.name) in ret.comment + assert f"Connected to network '{net.name}'." in ret.comment def test_run_with_onlyif(docker_container, container_name, image, modules): @@ -1021,7 +1019,7 @@ def test_run_with_creates( ) assert ret.result is True assert not ret.changes - assert ret.comment == "{} exists".format(good_file1) + assert ret.comment == f"{good_file1} exists" finally: try: modules.docker.rm(container_name, force=True) diff --git a/tests/unit/utils/test_pyobjects.py b/tests/unit/utils/test_pyobjects.py index c36a98dab18..4e005a6479b 100644 --- a/tests/unit/utils/test_pyobjects.py +++ b/tests/unit/utils/test_pyobjects.py @@ -25,7 +25,7 @@ from tests.support.runtests import RUNTIME_VARS from tests.support.unit import TestCase pytestmark = [ - pytest.mark.timeout_unless_on_windows(120), + pytest.mark.timeout_unless_on_windows(180), ] log = logging.getLogger(__name__) From 7c487d2c71a037ec4105ddefd412065101f6eaa7 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 28 Feb 2024 01:07:31 -0700 Subject: [PATCH 95/96] Adjust more test timeouts --- tests/pytests/functional/formulas/test_nginx.py | 4 ++++ tests/unit/utils/test_pyobjects.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/pytests/functional/formulas/test_nginx.py b/tests/pytests/functional/formulas/test_nginx.py index ea6381f7e3b..f1d86091185 100644 --- a/tests/pytests/functional/formulas/test_nginx.py +++ b/tests/pytests/functional/formulas/test_nginx.py @@ -3,6 +3,10 @@ Tests using nginx formula """ import pytest +pytestmark = [ + pytest.mark.timeout_unless_on_windows(120), +] + @pytest.fixture(scope="module") def _formula(saltstack_formula): diff --git a/tests/unit/utils/test_pyobjects.py b/tests/unit/utils/test_pyobjects.py index 4e005a6479b..981a3351cde 100644 --- a/tests/unit/utils/test_pyobjects.py +++ b/tests/unit/utils/test_pyobjects.py @@ -25,7 +25,7 @@ from tests.support.runtests import RUNTIME_VARS from tests.support.unit import TestCase pytestmark = [ - pytest.mark.timeout_unless_on_windows(180), + pytest.mark.timeout_unless_on_windows(240), ] log = logging.getLogger(__name__) From b3a19e6ad490875f90684b4bc086552918b2cd01 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 28 Feb 2024 11:18:21 +0000 Subject: [PATCH 96/96] Adjust timeout for windows --- tests/pytests/functional/states/test_docker_container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytests/functional/states/test_docker_container.py b/tests/pytests/functional/states/test_docker_container.py index 3eb8d836406..10e6509466d 100644 --- a/tests/pytests/functional/states/test_docker_container.py +++ b/tests/pytests/functional/states/test_docker_container.py @@ -29,7 +29,7 @@ pytestmark = [ pytest.mark.skip_if_binaries_missing( "docker", "dockerd", reason="Docker not installed" ), - pytest.mark.timeout(120), + pytest.mark.timeout_unless_on_windows(240), ] IPV6_ENABLED = bool(salt.utils.network.ip_addrs6(include_loopback=True))