Files
@ a0597f1f2578
Branch filter:
Location: majic-ansible-roles/roles/wsgi_website/molecule/default/tests/conftest.py - annotation
a0597f1f2578
1.0 KiB
text/x-python
MAR-239: Dropped support for Debian 11 Bullseye from the common role.
cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 cde12eec8256 | from collections import namedtuple
import pytest
@pytest.fixture
def python_info(host):
"""
Helper fixture used to define what the expected Python details
are (paths, package names etc) based on Debian release.
Currently supports:
- Debian 11 (Bullseye)
- Debian 12 (Bookworm)
Resulting information can be accessed through returned named tuple
with the following properties:
- python_version (version of installed Python interpreter)
"""
PythonInfo = namedtuple('PythonInfo', 'python_version')
ansible_facts = host.ansible("setup")["ansible_facts"]
ansible_distribution_release = ansible_facts['ansible_distribution_release']
if ansible_distribution_release == 'bullseye':
info = PythonInfo(python_version="3.9.2")
elif ansible_distribution_release == 'bookworm':
info = PythonInfo(python_version="3.11.2")
else:
raise Exception('The php_info pytest fixture does not support Debian release: %s' % ansible_distribution_release)
return info
|