-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix renovate tag, don't run SSH wrapper tests with 3006/3.12
3006 has issues with Python 3.12, which is the system default Python version of the new `ubuntu-24.04` runner.
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pytest | ||
import salt.version | ||
from packaging.version import Version | ||
|
||
|
||
@pytest.fixture(scope="module", autouse=True) | ||
def _check_host_python(salt_ssh_cli): | ||
""" | ||
When testing Salt 3006.*, the host's default Python version | ||
needs to be <3.12, otherwise Salt just crashes with an ImportError | ||
regarding ``backports.ssl_match_hostname``. | ||
""" | ||
if Version(salt.version.__version__) >= Version("3007"): | ||
return | ||
ret = salt_ssh_cli.run("--raw", "python3 --version") | ||
assert ret.returncode == 0 | ||
assert isinstance(ret.data, dict) | ||
python_version = Version(ret.data["stdout"].split(" ")[1]) | ||
if python_version >= Version("3.12"): | ||
pytest.skip( | ||
f"The host Python ({python_version}) is not supported by Salt {salt.version.__version__}" | ||
) |