def _process_new_remote_macs(self, context, new_remote_macs): for remote_mac in new_remote_macs: rm_dict = remote_mac rm_dict[n_const.OVSDB_IDENTIFIER] = self.ovsdb_identifier r_mac = db.get_ucast_mac_remote(context, rm_dict) if not r_mac: db.add_ucast_mac_remote(context, rm_dict)
def test_get_ucast_mac_remote(self): record_dict = self._get_ucast_mac_remote_dict() with self.ctx.session.begin(subtransactions=True): entry = self._create_ucast_mac_remote(record_dict) result = lib.get_ucast_mac_remote(self.ctx, record_dict) self.assertEqual(entry, result)