parse_version function - BlueCat Python Library - 24.2

BlueCat Python Library Guide

Locale
English
Product name
BlueCat Python Library
Version
24.2

bluecat_libraries.address_manager.version.parse_version(value)

Create a version object by parsing a string value.

Parameters Description
value (str)

A version number.

  • The version may have up to three parts.

  • The version parts should be separated by periods (.).

  • The version parts should be integers.

Return type: Version

Returns: The parsed version.

Example:

>>> s = "11.22"
>>> v = parse_version(s)
>>> assert str(v) == "11.22.0"
>>> assert repr(v) == "Version(major=11, minor=22, patch=0)"
>>> assert v.major == 11
>>> assert v[2] == 0

New in version 23.1.0.