Browse Source

NSX|V3+P: Create default SG outside the port create context

Change-Id: I6e32a0bb1a592e681b124a38ca59771f719af398
changes/20/778420/3
asarfaty 2 months ago
committed by Adit Sarfaty
parent
commit
aacf634faa
2 changed files with 10 additions and 0 deletions
  1. +5
    -0
      vmware_nsx/plugins/nsx_p/plugin.py
  2. +5
    -0
      vmware_nsx/plugins/nsx_v3/plugin.py

+ 5
- 0
vmware_nsx/plugins/nsx_p/plugin.py View File

@ -2101,6 +2101,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)


+ 5
- 0
vmware_nsx/plugins/nsx_v3/plugin.py View File

@ -1545,6 +1545,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)


Loading…
Cancel
Save