Merge "NSX|V3+P: Create default SG outside the port create context" into stable/ussuri

This commit is contained in:
Zuul 2021-03-04 16:09:53 +00:00 committed by Gerrit Code Review
commit fb97354df9
2 changed files with 10 additions and 0 deletions

View File

@ -2085,6 +2085,11 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
if is_external_net:
self._assert_on_external_net_with_compute(port_data)
# Do this outside of the context writer scope so it can overcome
# failures
if port.get('tenant_id'):
self._ensure_default_security_group(context, port['tenant_id'])
with db_api.CONTEXT_WRITER.using(context):
neutron_db = self.base_create_port(context, port)
port["port"].update(neutron_db)

View File

@ -1464,6 +1464,11 @@ class NsxV3Plugin(nsx_plugin_common.NsxPluginV3Base,
context, port_data, port_data['network_id'],
projectpluginmap.NsxPlugins.NSX_T)
# Do this outside of the context writer scope so it can overcome
# failures
if port.get('tenant_id'):
self._ensure_default_security_group(context, port['tenant_id'])
with db_api.CONTEXT_WRITER.using(context):
neutron_db = self.base_create_port(context, port)
port["port"].update(neutron_db)