utils.unix.yum_list_parser module

class utils.unix.yum_list_parser.YumListParser

Bases: object

compare_versions(cmdOutput, target_version, comparison='greater')

Compares software versions from cmdOutput to a target version, focusing on the first two components.

Parameters: cmdOutput (str): The output string from yum, e.g. “krb5-workstation.x86_64 1.18.2-28.el8_10 @rhel-8-base-rpms” target_version (str): The target version to compare against, e.g. “1.17-18.el8” comparison (str): Type of comparison to perform. Can be ‘greater’, ‘less’, ‘greater_or_equal’, or ‘less_or_equal’.

Returns: bool: True if cmdOutput version satisfies the comparison against target_version.