versionutils

Helpers for comparing version strings.

oslo_utils.versionutils.is_compatible(requested_version, current_version, same_major=True)

Determine whether requested_version is satisfied by current_version; in other words, current_version is >= requested_version.

Parameters:
  • requested_version – version to check for compatibility
  • current_version – version to check against
  • same_major – if True, the major version must be identical between requested_version and current_version. This is used when a major-version difference indicates incompatibility between the two versions. Since this is the common-case in practice, the default is True.
Returns:

True if compatible, False if not