salt/tests/pytests/integration/ssh/__init__.py
Daniel A. Wozniak fc0b20e657 More ssh test fixes
- Fix thin dir unit tests after distro change revert
- Skip any tests that require system python of 3.9 or higher
2025-02-19 00:26:32 -07:00

17 lines
452 B
Python

import subprocess
import packaging
def check_system_python_version():
"""
Validate the system python version is greater than 3.9
"""
try:
ret = subprocess.run(
["/usr/bin/python3", "--version"], capture_output=True, check=True
)
except FileNotFoundError:
return None
ver = ret.stdout.decode().split(" ", 1)[-1]
return packaging.version.Version(ver) >= packaging.version.Version("3.9")