'Create an API version object.
:param version_str: String representation of APIVersionRequest.
Correct format is \'X.Y\', where \'X\' and \'Y\'
are int values. None value should be used
to create Null APIVersionRequest, which is
equal to 0.0'

def __init__(self, version_str=None):

    self.ver_major = 0
    self.ver_minor = 0
    if (version_str is not None):
        match = re.match('^([1-9]\\d*)\\.([1-9]\\d*|0|latest)$', version_str)
        if match:
            self.ver_major = int(match.group(1))
            if (match.group(2) == 'latest'):
                self.ver_minor = float('inf')
            else:
                self.ver_minor = int(match.group(2))
        else:
            msg = (_("Invalid    format    of    client    version    '%s'.    Expected    format    'X.Y',    where    X    is    a    major    part    and    Y    is    a    minor    part    of    version.") % version_str)
            raise exceptions.UnsupportedVersion(msg)
