def METHOD_NAME(s):
    """Convert string into one of the provided version constants.  Raises
       KickstartVersionError if string does not match anything.
    """
    # First try these short forms.
    try:
        return versionMap[s.upper()]
    except KeyError:
        pass
    # Now try the Fedora versions.
    m = re.match(r"^fedora.* (\d+)$", s, re.I)      # pylint: disable=no-member
    if m and m.group(1):
        if "FC" + m.group(1) in versionMap:
            return versionMap["FC" + m.group(1)]
        elif "F" + m.group(1) in versionMap:
            return versionMap["F" + m.group(1)]
        else:
            raise KickstartVersionError(_("Unsupported version specified: %s") % s)
    # Now try the RHEL versions.
    m = re.match(r"^red hat enterprise linux.* (\d+)([\.\d]*)$", s, re.I)       # pylint: disable=no-member
    if m and m.group(1):
        if "RHEL" + m.group(1) in versionMap:
            return versionMap["RHEL" + m.group(1)]
        else:
            raise KickstartVersionError(_("Unsupported version specified: %s") % s)
    # If nothing else worked, we're out of options.
    raise KickstartVersionError(_("Unsupported version specified: %s") % s)