Get network devices from the profile and merge uer defined ones with them.

def _get_merged_nics(hypervisor, profile, interfaces=None, dmac=None):
    '''
    Get network devices from the profile and merge uer defined ones with them.
    '''
    nicp = _nic_profile(profile, hypervisor, dmac=dmac) if profile else []
    log.debug('NIC profile is %s', nicp)
    if interfaces:
        users_nics = _complete_nics(interfaces, hypervisor)
        for unic in users_nics:
            found = [nic for nic in nicp if nic['name'] == unic['name']]
            if found:
                found[0].update(unic)
            else:
                nicp.append(unic)
        log.debug('Merged NICs: %s', nicp)
    return nicp