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 tenacity
|
||||
|
||||
from networking_l2gw.db.l2gateway import l2gateway_models
|
||||
from neutron.extensions import securitygroup as ext_sg
|
||||
from neutron_fwaas.db.firewall.v2 import firewall_db_v2
|
||||
from neutron_lib.callbacks import registry
|
||||
|
@ -1463,10 +1464,15 @@ def pre_migration_checks(nsxlib, plugin):
|
|||
"running migration again.")
|
||||
return False
|
||||
if 'l2gw' in srv_plugin:
|
||||
LOG.error("Pre migration check failed: L2GW is not supported. "
|
||||
"Please delete its configuration and disable it, before "
|
||||
"running migration again.")
|
||||
return False
|
||||
# L2GW is not supported with the policy plugin
|
||||
admin_context = context.get_admin_context()
|
||||
l2gws = admin_context.session.query(
|
||||
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
|
||||
neutron_t0s = get_neurton_tier0s(plugin)
|
||||
|
@ -1488,6 +1494,7 @@ def pre_migration_checks(nsxlib, plugin):
|
|||
"try again.")
|
||||
return False
|
||||
|
||||
LOG.info("Pre migration check succeeded")
|
||||
return True
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue