Skip to content

Draft: move distro_detect() and tags to os-release, remove el7 stuff in preparation

David Jaša requested to merge dj/introduce-os-release into main

Two rather invasive changes:

remove el7 stuff

el7 is not supported by main branch for months so in preparation for one of the next commits, all ifs searching for Maipo, el7 etc... are removed

switch all python distro detection to os-release

We used pretty hacky stuff for distro detection: saving contents of /etc/redhat-release to Behave context, using grep and sed tricks to extract if we're on RHEL, CentOS or Fedora. All of this can pull from os-release (introduction on Lennart's blog and FAQ from that time) file in quite universal manner. This MR adds get_os_release() function that reads os-release file(s), parses the content and caches it and moves nmci.test_version_check() and all release-dependent ifs in tags.py and ctx.py to it.

@RunFeatures:all

Edited by David Jaša

Merge request reports