OSRelease
The OSRelease
combiner uses the following parsers to try to identify if the
current host is installed with a “Red Hat Enterprise Linux” (RHEL) system.
insights.parsers.os_release.OSRelease
It provides an attribute is_rhel that indicates if the host is RHEL or not. It also provides an attribute release which returns the estimated OS release name of the system, “Unknown” will be returned by default when cannot identify the OS.
TODO:
The lists of keywords to identify NON-RHEL system of each sub-combiners are based on our current knowledge, and may be not sufficient. It needs to be updated timely according to new found Linux Distributions.
- insights.combiners.os_release.MINIMUM_RHEL_PKGS = ['audit-libs', 'basesystem', 'bash', 'coreutils', 'dbus', 'dmidecode', 'dnf', 'dracut', 'filesystem', 'firewalld', 'glibc', 'gmp', 'krb5-libs', 'libacl', 'libgcc', 'libselinux', 'NetworkManager', 'openssl-libs', 'passwd', 'redhat-release', 'redhat-release-server', 'systemd', 'util-linux', 'yum']
Must-install packages for minimum installed RHEL system.
- class insights.combiners.os_release.OSRelease(uname, dmesg, rpms, osr, rhr)[source]
Bases:
object
A Combiner identifies whether the current Linux a Red Hat Enterprise Linux or not.
Examples
>>> type(osr) <class 'insights.combiners.os_release.OSRelease'> >>> osr.is_rhel False >>> osr.release == "Oracle" True >>> osr.name == "Oracle Linux Server" True >>> osr.is_rhel_compatible False >>> 'kernel' in osr.reasons.keys() False >>> 'faulty_packages' in osr.reasons.keys() True >>> 'glibc-2.28-211.el8' in osr.reasons['faulty_packages'] True
- property is_rhel
Returns True if it’s RHEL, False for NON-RHEL.
- property is_rhel_compatible
Returns True if Convert2RHEL could convert
- property name
Returns the name of the OS. Generally it’s the
NAME
of the /etc/os-release file, or it’s the same as the release when the /etc/os-release is not available.
- property product
Alias of release. Keep backward compatible
- property reasons
Returns a dict indicating why the host is a NON-RHEL. Empty when it’s an RHEL. The keys include:
kernel (str): the kernel package build_info (str): the kernel build information release (str): the release package faulty_packages (list): the packages that are not signed and not provided by Red Hat reason (str): a string when nothing is available to check
- property release
Returns the estimated release name of the running Linux. It’s RHEL or one key of the
OTHER_LINUX_KEYS
when it’s NON-RHEL.
- insights.combiners.os_release.OTHER_LINUX_KEYS = {'AlmaLinux': (['almalinux'], ['almalinux-release']), 'CentOS': (['centos'], ['centos-stream-release', 'centos-release']), 'ClearOS': (['clearos'], ['clearos-release']), 'CloudLinux': (['cloudlinux'], ['cloudlinux-release']), 'Fedora': (['fedora'], ['fedora-release']), 'Oracle': (['oracle'], ['enterprise-release', 'oraclelinux-release']), 'Rocky': (['rockylinux', 'rocky'], ['rocky-release']), 'SUSE': (['suse', 'sles', 'novell'], ['sles-release', 'sles_es-release-server']), 'Scientific': ([], ['sl-release'])}
Known NON-RHEL Linux Distributions.
- insights.combiners.os_release.THRESHOLD = 0.75
Threshold of the must-install packages to identify NON-RHEL.