def _build_primary_nics(all_nics):
    """
    Aggregate all nics into their primary groups.
    I.E. All nic\.X.\.*\.Y nics go into a list where all X's are the same.

    :param all_nics: All nics to consider.
    :type all_nics: list
    """
    primary_nics = {}
    for nic in all_nics:
        if not isinstance(nic.key, basestring):
            log("=" * 15, DEBUG)
            log("System {0} and NIC {1} not in valid format.  Value is not "
                    "type basestring Skipping.".format(nic.system, nic), DEBUG)
            log(print_system(nic.system), DEBUG)
            continue
        possible_primary_nic = get_nic_primary_number.match(nic.key)
        if not possible_primary_nic:
            log("=" * 15, DEBUG)
            log("System {0} and NIC {1} not in valid format. "
                "Skipping.".format(nic.system, nic), DEBUG)
            log(print_system(nic.system), DEBUG)
            continue
        primary_nic_number = possible_primary_nic.group(1)
        if primary_nics in primary_nic_number:
            primary_nics[primary_nic_number]['nics'].append(nic)
        else:
            primary_nics[primary_nic_number] = {'nics': [nic]}
    return primary_nics
dataset/ETHPy150Open mozilla/inventory/migrate_dns/build_nics.py/_build_primary_nics/swapped operands of `in`