From 8758b85413bbe78e2e04781342283d4c2db9ec03 Mon Sep 17 00:00:00 2001 From: Aaron Rosen Date: Thu, 9 Jul 2015 15:45:19 -0700 Subject: [PATCH] create_port in plugin is sometimes called within a transaction This patch fixes this that problem and allows these tests to pass: TestPortsV2.test_create_ports_bulk_emulated TestPortsV2.test_create_ports_bulk_native Change-Id: I44a3e0be7bd5b07538839d883e551ba548da9ebd --- vmware_nsx/neutron/plugins/vmware/plugins/nsx_v3_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v3_plugin.py b/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v3_plugin.py index c26292cb47..8d6ad0c2f8 100644 --- a/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v3_plugin.py +++ b/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v3_plugin.py @@ -131,7 +131,7 @@ class NsxV3Plugin(db_base_plugin_v2.NeutronDbPluginV2, tags = utils.build_v3_tags_payload(port['port']) port['port']['id'] = port_id # TODO(salv-orlando): Undo logical switch creation on failure - with context.session.begin(): + with context.session.begin(subtransactions=True): neutron_db = super(NsxV3Plugin, self).create_port(context, port) port["port"].update(neutron_db) address_bindings = self._build_address_bindings(port['port'])