IsRhel - components to check RHEL version
IsRhel#, IsGtRhel#, IsGtOrRhel# component are included in this
module.
The component is valid if the RHEL version got from the
insights.combiners.redhat_release.RedHatRelease of the current
host satisfies the requirements. Otherwise, it raises a
insights.core.exceptions.SkipComponent to prevent dependent
components from triggering.
In particular, the component can be added as a dependency of another components, e.g. Specs or Parsers parser to limit it to a given version.
- class insights.components.rhel_version.IsGtOrRhel84(rhel)[source]
Bases:
IsGtRhelThis component checks if the RHEL version is 8.4 or greater than 8.4.
- major
The major version of RHEL.
- Type:
int
- minor
The minor version of RHEL.
- Type:
int
- Raises:
SkipComponent -- When RHEL version is not 8.4 and less than 8.4
- class insights.components.rhel_version.IsGtOrRhel86(rhel)[source]
Bases:
IsGtRhelThis component checks if the RHEL version is 8.6 or greater than 8.6.
- major
The major version of RHEL.
- Type:
int
- minor
The minor version of RHEL.
- Type:
int
- Raises:
SkipComponent -- When RHEL version is not 8.6 and less than 8.6
- class insights.components.rhel_version.IsGtRhel(rhel, major, minor, equal=False)[source]
Bases:
objectThis component uses
RedHatReleasecombiner to determine the RHEL version. It then checks if the major version matches the version argument, if it doesn’t it raisesSkipComponent.When equal is set to True, it checks “greater than or equal”. Otherwise, it only checks “greater than”.
- major
The major version of RHEL.
- Type:
int
- minor
The minor version of RHEL.
- Type:
int
- Raises:
SkipComponent -- When RHEL version does not match the specified version.
- class insights.components.rhel_version.IsGtRhel86(rhel)[source]
Bases:
IsGtRhelThis component checks if the RHEL version is greater than 8.6.
- major
The major version of RHEL.
- Type:
int
- minor
The minor version of RHEL.
- Type:
int
- Raises:
SkipComponent -- When RHEL version is 8.6 or less than 8.6
- class insights.components.rhel_version.IsGtRhel9(rhel)[source]
Bases:
IsGtRhelThis component checks if the RHEL version is greater than 9.
- major
The major version of RHEL.
- Type:
int
- minor
The minor version of RHEL.
- Type:
int
- Raises:
SkipComponent -- When RHEL version is 9.x or less than 9.0
- class insights.components.rhel_version.IsRhel(rhel, major=None)[source]
Bases:
objectThis component uses
RedHatReleasecombiner to determine the RHEL major version. It then checks if the major version matches the version argument, if it doesn’t it raisesSkipComponent.- minor
The minor version of RHEL.
- Type:
int
- Raises:
SkipComponent -- When RHEL major version does not match version.
- class insights.components.rhel_version.IsRhel10(rhel)[source]
Bases:
IsRhelThis component checks if it’s RHEL 10.
- minor
The minor version of RHEL 10.
- Type:
int
- Raises:
SkipComponent -- When RHEL version is not RHEL 10.
- class insights.components.rhel_version.IsRhel6(rhel)[source]
Bases:
IsRhelThis component checks if it’s RHEL 6.
- minor
The minor version of RHEL 6.
- Type:
int
- Raises:
SkipComponent -- When RHEL version is not RHEL 6.
- class insights.components.rhel_version.IsRhel7(rhel)[source]
Bases:
IsRhelThis component checks if it’s RHEL 7.
- minor
The minor version of RHEL 7.
- Type:
int
- Raises:
SkipComponent -- When RHEL version is not RHEL 7.
- class insights.components.rhel_version.IsRhel8(rhel)[source]
Bases:
IsRhelThis component checks if it’s RHEL 8.
- minor
The minor version of RHEL 8.
- Type:
int
- Raises:
SkipComponent -- When RHEL version is not RHEL 8.
- class insights.components.rhel_version.IsRhel9(rhel)[source]
Bases:
IsRhelThis component checks if it’s RHEL 9.
- minor
The minor version of RHEL 9.
- Type:
int
- Raises:
SkipComponent -- When RHEL version is not RHEL 9.