예제 #1
0
def add_physical_locator(context, record_dict):
    """Insert a new physical locator."""
    session = context.session
    with session.begin(subtransactions=True):
        locator = models.PhysicalLocators(
            uuid=record_dict['uuid'],
            dst_ip=record_dict['dst_ip'],
            ovsdb_identifier=record_dict['ovsdb_identifier'])
        session.add(locator)
예제 #2
0
 def _create_physical_locator(self, record_dict, dst_ip=None):
     if dst_ip:
         record_dict['dst_ip'] = dst_ip
     with self.ctx.session.begin(subtransactions=True):
         entry = models.PhysicalLocators(
             uuid=record_dict['uuid'],
             dst_ip=record_dict['dst_ip'],
             ovsdb_identifier=record_dict['ovsdb_identifier'])
         self.ctx.session.add(entry)
         return entry