MP2P migration: fix L2gw validation
Since l2gw can be enabled by default we need to actually check the resources existence. Change-Id: I78f5c4e81d069acbeaad7a83378eb55c1231c30b
This commit is contained in:
parent
4acd6417fa
commit
62ec7a453e
|
@ -21,6 +21,7 @@ import logging
|
||||||
import paramiko
|
import paramiko
|
||||||
import tenacity
|
import tenacity
|
||||||
|
|
||||||
|
from networking_l2gw.db.l2gateway import l2gateway_models
|
||||||
from neutron.extensions import securitygroup as ext_sg
|
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
|
||||||
|
@ -1463,10 +1464,15 @@ def pre_migration_checks(nsxlib, plugin):
|
||||||
"running migration again.")
|
"running migration again.")
|
||||||
return False
|
return False
|
||||||
if 'l2gw' in srv_plugin:
|
if 'l2gw' in srv_plugin:
|
||||||
LOG.error("Pre migration check failed: L2GW is not supported. "
|
# L2GW is not supported with the policy plugin
|
||||||
"Please delete its configuration and disable it, before "
|
admin_context = context.get_admin_context()
|
||||||
"running migration again.")
|
l2gws = admin_context.session.query(
|
||||||
return False
|
l2gateway_models.L2Gateway).all()
|
||||||
|
if len(l2gws):
|
||||||
|
LOG.error("Pre migration check failed: L2GW is not supported. "
|
||||||
|
"Please delete all its resources, before "
|
||||||
|
"running migration again.")
|
||||||
|
return False
|
||||||
|
|
||||||
# Tier0 with disabled BGP config
|
# Tier0 with disabled BGP config
|
||||||
neutron_t0s = get_neurton_tier0s(plugin)
|
neutron_t0s = get_neurton_tier0s(plugin)
|
||||||
|
@ -1488,6 +1494,7 @@ def pre_migration_checks(nsxlib, plugin):
|
||||||
"try again.")
|
"try again.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
LOG.info("Pre migration check succeeded")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue