Пример #1
0
 def test_get_physical_locator_by_dst_ip(self):
     record_dict = self._get_physical_locator_dict()
     with self.ctx.session.begin(subtransactions=True):
         entry = self._create_physical_locator(record_dict, '20.0.0.1')
     record_dict['dst_ip'] = '20.0.0.1'
     record_dict.pop('uuid')
     result = lib.get_physical_locator_by_dst_ip(self.ctx, record_dict)
     self.assertEqual(entry, result)
Пример #2
0
 def _form_physical_locator_schema(self, context, pl_dict):
     locator_uuid = None
     locator = db.get_physical_locator_by_dst_ip(context, pl_dict)
     if locator:
         locator_uuid = locator.get('uuid')
     physical_locator = self._get_dict(
         ovsdb_schema.PhysicalLocator(uuid=locator_uuid,
                                      dst_ip=pl_dict.get('dst_ip')))
     return physical_locator
Пример #3
0
 def _form_physical_locator_schema(self, context, pl_dict):
     locator_uuid = None
     locator = db.get_physical_locator_by_dst_ip(
         context, pl_dict)
     if locator:
         locator_uuid = locator.get('uuid')
     physical_locator = self._get_dict(
         ovsdb_schema.PhysicalLocator(uuid=locator_uuid,
                                      dst_ip=pl_dict.get('dst_ip')))
     return physical_locator
Пример #4
0
 def _get_locator_list(self, context, dst_ip, ovsdb_identifier, mac_list,
                       locator_list):
     locator_uuid = None
     locator_dict = self._get_physical_locator_dict(dst_ip, None, None,
                                                    ovsdb_identifier)
     locator = db.get_physical_locator_by_dst_ip(context, locator_dict)
     if locator:
         locator_uuid = locator.get('uuid')
     for locator in locator_list:
         if (locator.get('dst_ip') == dst_ip):
             (locator.get('macs')).extend(mac_list)
             return locator_list
     pl_dict = self._get_physical_locator_dict(dst_ip, locator_uuid,
                                               mac_list)
     locator_list.append(pl_dict)
     return locator_list
Пример #5
0
 def _get_locator_list(self, context, dst_ip, ovsdb_identifier,
                       mac_list, locator_list):
     locator_uuid = None
     locator_dict = self._get_physical_locator_dict(
         dst_ip, None, None, ovsdb_identifier)
     locator = db.get_physical_locator_by_dst_ip(
         context, locator_dict)
     if locator:
         locator_uuid = locator.get('uuid')
     for locator in locator_list:
         if(locator.get('dst_ip') == dst_ip):
             (locator.get('macs')).extend(mac_list)
             return locator_list
     pl_dict = self._get_physical_locator_dict(
         dst_ip, locator_uuid, mac_list)
     locator_list.append(pl_dict)
     return locator_list