def process_interface_files(infile, interfaces):
    """
    Write out a new files for interfaces
    """

    # Enumerate all of the existing ifcfg-* files
    remove_files = set()
    for filepath in glob.glob(NETCONFIG_DIR + "/ifcfg-*"):
        if '.' not in filepath:
            remove_files.add(filepath)
    for filename in glob.glob(NETCONFIG_DIR + "/route-*"):
        if '.' not in filepath:
            remove_files.add(filepath)

    lo_file = os.path.join(NETCONFIG_DIR, INTERFACE_FILE % 'lo')
    if lo_file in remove_files:
        remove_files.remove(lo_file)

    update_files = {}

    ipv6 = False
    for ifname, interface in interfaces.iteritems():
        ifaces, route_data = _get_file_data(ifname, interface)
        if interface['ip6s']:
            ipv6 = True

        for ifname, data in ifaces:
            filepath = os.path.join(NETCONFIG_DIR, INTERFACE_FILE % ifname)
            update_files[filepath] = data
            if remove_files in filepath:
                remove_files.remove(filepath)

        if route_data:
            filepath = os.path.join(NETCONFIG_DIR, ROUTE_FILE % ifname)
            update_files[filepath] = route_data
            if filepath in remove_files:
                remove_files.remove(filepath)

    update_files[NETWORK_FILE] = _update_key_value(infile, 'NETWORKING_IPV6',
            ipv6 and 'yes' or 'no')

    return update_files, remove_files
dataset/ETHPy150Open rackerlabs/openstack-guest-agents-unix/commands/redhat/network.py/process_interface_files/swapped operands of `in`