Exemple #1
0
    def canonicalize(cls, name):
        """Canonicalize the hypervisor type name

        :param name: hypervisor type name to canonicalize

        :returns: a canonical hypervisor type name
        """
        if name is None:
            return None

        newname = name.lower()

        if newname == 'xapi':
            newname = cls.XEN

        if not cls.is_valid(newname):
            raise exception.InvalidHypervisorVirtType(hv_type=name)

        return newname
def canonicalize(name):
    """Canonicalize the hypervisor type name

    :param name: hypervisor type name to canonicalize

    :returns: a canonical hypervisor type name
    """

    if name is None:
        return None

    newname = name.lower()

    if newname == "xapi":
        newname = XEN
    elif newname == "powervm":
        # TODO(mriedem): Remove the translation shim in the 2015.2 'L' release.
        newname = PHYP

    if not is_valid(newname):
        raise exception.InvalidHypervisorVirtType(hv_type=name)

    return newname