def bvi_unique(yaml, bviname):
    """Returns True if the BVI identified by bviname is unique among all BridgeDomains."""
    if not "bridgedomains" in yaml:
        return True
    ncount = 0
    for _ifname, iface in yaml["bridgedomains"].items():
        if "bvi" in iface and iface["bvi"] == bviname:
            ncount += 1
    return ncount < 2