Exemplo n.º 1
0
 def _process_deleted_physical_locators(self, context,
                                        deleted_physical_locators):
     physical_switch_ips = []
     logical_switch_ids = self._get_logical_switch_ids(context)
     physical_switches = db.get_all_physical_switches_by_ovsdb_id(
         context, self.ovsdb_identifier)
     for physical_switch in physical_switches:
         physical_switch_ips.append(physical_switch.get('tunnel_ip'))
     tunneling_ip_dict = self._get_agent_ips(context)
     for physical_locator in deleted_physical_locators:
         pl_dict = physical_locator
         pl_dict[n_const.OVSDB_IDENTIFIER] = self.ovsdb_identifier
         agent_ip = physical_locator.get('dst_ip')
         if agent_ip in tunneling_ip_dict.keys():
             for logical_switch_id in logical_switch_ids:
                 for physical_switch_ip in physical_switch_ips:
                     other_fdb_entries = self._get_fdb_entries(
                         context, physical_switch_ip, logical_switch_id)
                     agent_host = tunneling_ip_dict.get(agent_ip)
                     self.tunnel_call.trigger_l2pop_delete(
                         context, other_fdb_entries, agent_host)
         else:
             for logical_switch_id in logical_switch_ids:
                 other_fdb_entries = self._get_fdb_entries(
                     context, agent_ip, logical_switch_id)
                 self.tunnel_call.trigger_l2pop_delete(
                     context, other_fdb_entries)
         db.delete_physical_locator(context, pl_dict)
Exemplo n.º 2
0
 def _process_deleted_physical_locators(self,
                                        context,
                                        deleted_physical_locators):
     physical_switch_ips = []
     logical_switch_ids = self._get_logical_switch_ids(context)
     physical_switches = db.get_all_physical_switches_by_ovsdb_id(
         context, self.ovsdb_identifier)
     for physical_switch in physical_switches:
         physical_switch_ips.append(
             physical_switch.get('tunnel_ip'))
     tunneling_ip_dict = self._get_agent_ips(context)
     for physical_locator in deleted_physical_locators:
         pl_dict = physical_locator
         pl_dict[n_const.OVSDB_IDENTIFIER] = self.ovsdb_identifier
         agent_ip = physical_locator.get('dst_ip')
         if agent_ip in tunneling_ip_dict.keys():
             for logical_switch_id in logical_switch_ids:
                 for physical_switch_ip in physical_switch_ips:
                     other_fdb_entries = self._get_fdb_entries(
                         context, physical_switch_ip, logical_switch_id)
                     agent_host = tunneling_ip_dict.get(agent_ip)
                     self.tunnel_call.trigger_l2pop_delete(
                         context, other_fdb_entries, agent_host)
         else:
             for logical_switch_id in logical_switch_ids:
                 other_fdb_entries = self._get_fdb_entries(
                     context, agent_ip, logical_switch_id)
                 self.tunnel_call.trigger_l2pop_delete(
                     context, other_fdb_entries)
         db.delete_physical_locator(context, pl_dict)
Exemplo n.º 3
0
 def test_delete_physical_locator(self):
     record_dict = self._get_physical_locator_dict()
     self._create_physical_locator(record_dict)
     lib.delete_physical_locator(self.ctx, record_dict)
     count = self.ctx.session.query(models.PhysicalLocators).count()
     self.assertEqual(count, 0)