Enhance OS version parsing to handle SUSE SP notation #248
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR enhances the
versionGrok
regex pattern within makeOSInfo to support SUSE Linux Enterprise Server (SLES) versions that useSP
notation for Service Packs, such as15-SP5
.The updated regex now recognizes
SP
as a valid separator for the minor version, allowing accurate parsing of SLES versions alongside standard major.minor.patch formats (e.g.,22.04
). This change resolves issues where Minor was incorrectly set to0
forSP
-based versions and ensures compatibility with both SUSE-specific and conventional version formats.Changes
Updated
versionGrok
regex: Added optional SP notation support as a prefix for the minor version.Compatibility maintained: Supports both
.
and-
delimiters to handle multiple versioning schemes.Testing
Test cases added: Included tests for both
SLES 15-SP5
andSLED 15-SP5
to validate correct assignment of major, minor, and patch values.