MP2P migration: handle orphaned SG migration
Do not fail the migration in case the migrated SG not found in neutron Change-Id: I0aa7d181dff2f2bd9fffc462f25bd1b1ce4e3581
This commit is contained in:
parent
339c9d57a3
commit
b44e0639c3
@ -19,6 +19,7 @@ import logging
|
|||||||
import paramiko
|
import paramiko
|
||||||
import tenacity
|
import tenacity
|
||||||
|
|
||||||
|
from neutron.extensions import securitygroup as ext_sg
|
||||||
from neutron_fwaas.db.firewall.v2 import firewall_db_v2
|
from neutron_fwaas.db.firewall.v2 import firewall_db_v2
|
||||||
from neutron_lib.callbacks import registry
|
from neutron_lib.callbacks import registry
|
||||||
from neutron_lib import context
|
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:
|
if policy_id == p_plugin.NSX_P_DEFAULT_SECTION:
|
||||||
category = p_plugin.NSX_P_DEFAULT_SECTION_CATEGORY
|
category = p_plugin.NSX_P_DEFAULT_SECTION_CATEGORY
|
||||||
else:
|
else:
|
||||||
sg = plugin.get_security_group(ctx, policy_id)
|
try:
|
||||||
provider = sg.get('provider')
|
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:
|
if provider:
|
||||||
category = p_plugin.NSX_P_PROVIDER_SECTION_CATEGORY
|
category = p_plugin.NSX_P_PROVIDER_SECTION_CATEGORY
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user