Browse Source

MP2P migration: handle orphaned SG migration

Do not fail the migration in case the migrated SG not found in neutron

Change-Id: I0aa7d181dff2f2bd9fffc462f25bd1b1ce4e3581
changes/34/748834/1
asarfaty 3 weeks ago
committed by Adit Sarfaty
parent
commit
97bf9ca2ce
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      vmware_nsx/shell/admin/plugins/nsxv3/resources/migration.py

+ 9
- 2
vmware_nsx/shell/admin/plugins/nsxv3/resources/migration.py View File

@@ -19,6 +19,7 @@ import logging
import paramiko
import tenacity

from neutron.extensions import securitygroup as ext_sg
from neutron_fwaas.db.firewall.v2 import firewall_db_v2
from neutron_lib.callbacks import registry
from neutron_lib import context
@@ -992,8 +993,14 @@ def migrate_dfw_sections(nsxlib, nsxpolicy, plugin):
if policy_id == p_plugin.NSX_P_DEFAULT_SECTION:
category = p_plugin.NSX_P_DEFAULT_SECTION_CATEGORY
else:
sg = plugin.get_security_group(ctx, policy_id)
provider = sg.get('provider')
try:
sg = plugin.get_security_group(ctx, policy_id)
except ext_sg.SecurityGroupNotFound:
LOG.warning("Neutron SG %s was not found. Section %s may be "
"an orphaned", policy_id, resource['id'])
provider = False
else:
provider = sg.get('provider')
if provider:
category = p_plugin.NSX_P_PROVIDER_SECTION_CATEGORY



Loading…
Cancel
Save