def _merge_extraconfig(existing, changes):
    """Imposes the changes in extraConfig over the existing extraConfig."""
    existing = existing or []
    if (changes):
        for c in changes:
            if len([x for x in existing if x.key == c.key]) > 0:
                extraConf = [x for x in existing if x.key == c.key][0]
                extraConf.value = c.value
            else:
                existing.append(c)
    return existing
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/virt/vmwareapi/fake.py/_merge_extraconfig/original