@property
def mlag_bonds(self):
    mlag_bonds = mf['mlag_bonds']
    vids = {}
    for (tenant, vlans) in self.vlans.items():
        ids = []
        for vlan in vlans:
            ids.append(vlan['id'])
            vids[tenant] = ids
    vids_list = [x for i in vids.values() for x in i]

    def _get_tenant(vid):
        return ''.join([k for (k, v) in self.vlans.items() for i in v if (i['id'] == vid)])
    for (rack, bonds) in mlag_bonds.items():
        mems = filter.uncluster([i for v in bonds for i in v['members'].split(',')])
        for mem in set(mems):
            if (mems.count(mem) > 1):
                self._mlag_bonds_error(rack, mem, ('bond member conflict: ' + mem))
        names = [v['name'] for v in bonds]
        for name in set(names):
            if (names.count(name) > 1):
                self._mlag_bonds_error(rack, name, ('bond name conflict: ' + name))
        for bond in bonds:
            set_items = set([])
            bond_vids = filter.uncluster(bond['vids'])
            for bond_vid in bond_vids:
                if (bond_vid not in vids_list):
                    self._mlag_bonds_error(rack, bond['vids'], ('VLANID not found: ' + bond_vid))
            if (len(bond_vids) > 1):
                for bond_vid in bond_vids:
                    set_items.add((_get_tenant(bond_vid), bond['vids']))
            if (len(set_items) > 1):
                title = 'bond assigned with a VLANID which belongs to multiple tenant: '
                for item in set_items:
                    self._mlag_bonds_error(rack, item[1], title)
    return mlag_bonds
@property
def mlag_bonds(self):
    mlag_bonds = mf['mlag_bonds']
    vids = {}
    for (tenant, vlans) in self.vlans.items():
        ids = []
        for vlan in vlans:
            ids.append(vlan['id'])
            vids[tenant] = ids
    vids_list = [x for i in vids.values() for x in i]

    def _get_tenant(vid):
        return .join([k for (k, v) in self.vlans.items() for i in v if (i['id'] == vid)])
    for (rack, bonds) in mlag_bonds.items():
        mems = filter.uncluster([i for v in bonds for i in v['members'].split(',')])
        for mem in set(mems):
            if (mems.count(mem) > 1):
                self._mlag_bonds_error(rack, mem, ('bond member conflict: ' + mem))
        names = [v['name'] for v in bonds]
        for name in set(names):
            if (names.count(name) > 1):
                self._mlag_bonds_error(rack, name, ('bond name conflict: ' + name))
        for bond in bonds:
            set_items = set([])
            bond_vids = filter.uncluster(bond['vids'])
            for bond_vid in bond_vids:
                if (bond_vid not in vids_list):
                    self._mlag_bonds_error(rack, bond['vids'], ('VLANID not found: ' + bond_vid))
            if (len(bond_vids) > 1):
                for bond_vid in bond_vids:
                    set_items.add((_get_tenant(bond_vid), bond['vids']))
            if (len(set_items) > 1):
                title = 'bond assigned with a VLANID which belongs to multiple tenant: '
                for item in set_items:
                    self._mlag_bonds_error(rack, item[1], title)
    return mlag_bonds