OSRelease¶
The OSRelease
combiner uses the following parsers to try to identify if the
current host is installed with a “Red Hat Enterprise Linux” system.
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 maybe 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 >>> sorted(osr.reasons.keys()) ['build_info', 'faulty_packages', 'kernel', 'kernel_vendor'] >>> 'version kernel-4.18.0-372.19.1.el8_6uek' in osr.reasons['build_info'] True >>> osr.reasons['kernel'] '4.18.0-372.19.1.el8_6uek.x86_64' >>> osr.reasons['kernel_vendor'] == 'Oracle America' 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 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.
- insights.combiners.os_release.THRESHOLD = 0.75¶
Threshold of the must-install packages to identify NON-RHEL