def _cmp_by_local_pref(path1, path2):
    # TODO(PH): Revisit this when BGPS has concept of policy to be applied to
    # in-bound NLRIs.
    # Default local-pref values is 100
    lp1 = path1.get_pattr(BGP_ATTR_TYPE_LOCAL_PREF)
    lp2 = path2.get_pattr(BGP_ATTR_TYPE_LOCAL_PREF)
    if not (lp1 and lp2):
        return None

    # Highest local-preference value is preferred.
    lp1 = lp1.value
    lp2 = lp2.value
    if lp1 > lp2:
        return path1
    elif lp2 > lp1:
        return path2
    else:
        return None
Get compute nodes by hypervisor hostname.
dataset/ETHPy150Open osrg/ryu/ryu/services/protocols/bgp/processor.py/_cmp_by_local_pref--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/db/api.py/compute_node_search_by_hypervisor