Merge "V2T migration: reorder networks replay" into stable/victoria

This commit is contained in:
Zuul 2021-03-01 07:42:31 +00:00 committed by Gerrit Code Review
commit 3c791fb53e
1 changed files with 13 additions and 0 deletions

View File

@ -590,6 +590,19 @@ class ApiReplayClient(utils.PrepareObjectForMigration):
dest_azs = self.get_dest_availablity_zones('network')
total_num = len(source_networks)
# Reorder the source networks as we need to migrate the external first
# This is mandatory as vlan networks cannot be added to a router with
# no GW
external = []
internal = []
for network in source_networks:
if network.get('router:external'):
external.append(network)
else:
internal.append(network)
source_networks = external + internal
LOG.info("Migrating %(nets)s networks, %(subnets)s subnets and "
"%(ports)s ports",
{'nets': total_num, 'subnets': len(source_subnets),