def ParseVersion(versionstring):
  m = _FULL_VERSION_RE.match(versionstring)
  if m is not None:
    return (int(m.group(1)), int(m.group(2)), int(m.group(3)))

  m = _SHORT_VERSION_RE.match(versionstring)
  if m is not None:
    return (int(m.group(1)), int(m.group(2)), 0)

  return None
Parses a version string.
dataset/ETHPy150Open ganeti/ganeti/lib/utils/version.py/ParseVersion