'Canonicalize the architecture name
:param name: architecture name to canonicalize
:returns: a canonical architecture name'

@classmethod
def canonicalize(cls, name):

    if (name is None):
        return None
    newname = name.lower()
    if (newname in ('i386', 'i486', 'i586')):
        newname = cls.I686
    if (newname in ('x86_32', 'x86_32p')):
        newname = cls.I686
    if (newname == 'amd64'):
        newname = cls.X86_64
    if (not cls.is_valid(newname)):
        raise exception.InvalidArchitectureName(arch=name)
    return newname
