utils¶
- virtualitics_sdk.utils.compare_platform_version(version, comparison='>=')¶
Compare platform version with a provided semver version string. Supports partial version matching when using “=” comparison.
- Parameters:
version (
str
) – A semver format version string like: “1.24.0” or partial like “1.24” or “1”comparison (
str
) – Comparison operator, one of “>”, “>=”, “<”, “<=”, “=”
- Return type:
bool
- Returns:
bool: True if the platform version satisfies the comparison with the input version
- Examples:
>>> platform_version = (1, 24, 0) >>> compare_platform_version("1.24.0", "=") # True >>> compare_platform_version("1.24", "=") # True (partial match) >>> compare_platform_version("1", "=") # True (partial match) >>> compare_platform_version("1.23.0", ">=") # True >>> compare_platform_version("1.23.0", ">") # True >>> compare_platform_version("1.24.0", "<=") # True >>> compare_platform_version("1.25.0", "<") # True
- virtualitics_sdk.utils.get_platform_version_info()¶
Retrieve the platform version information as a tuple of integers (major, minor, patch)
- Return type:
Tuple
[int
,int
,int
]- Returns:
(major, minor, patch)