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
This commit is contained in:
parent
84b7c29994
commit
8758b85413
@ -131,7 +131,7 @@ class NsxV3Plugin(db_base_plugin_v2.NeutronDbPluginV2,
|
|||||||
tags = utils.build_v3_tags_payload(port['port'])
|
tags = utils.build_v3_tags_payload(port['port'])
|
||||||
port['port']['id'] = port_id
|
port['port']['id'] = port_id
|
||||||
# TODO(salv-orlando): Undo logical switch creation on failure
|
# 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)
|
neutron_db = super(NsxV3Plugin, self).create_port(context, port)
|
||||||
port["port"].update(neutron_db)
|
port["port"].update(neutron_db)
|
||||||
address_bindings = self._build_address_bindings(port['port'])
|
address_bindings = self._build_address_bindings(port['port'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user