def _create_mac_learning_state(self, context, port): with db_api.CONTEXT_WRITER.using(context): enabled = port[mac.MAC_LEARNING] state = nsx_models.MacLearningState(port_id=port['id'], mac_learning_enabled=enabled) context.session.add(state) return self._make_mac_learning_state_dict(state)
def _create_mac_learning_state(self, context, port): with context.session.begin(subtransactions=True): enabled = port[mac.MAC_LEARNING] state = nsx_models.MacLearningState(port_id=port['id'], mac_learning_enabled=enabled) context.session.add(state) return self._make_mac_learning_state_dict(state)