Properly iterate through VIPs

In the original form, the iterator was changed inside
the loop. Iterating through separate list object
fixes this issue.

Change-Id: I8c2a47b54f1339669f9f20f1a420a028044cb9d8
Closes-bug: 1539039
This commit is contained in:
Oleg Gelbukh 2016-03-09 18:42:21 +00:00 committed by Nikita Zubkov
parent 6db717cff2
commit 8f29bf537d
1 changed files with 4 additions and 5 deletions

View File

@ -159,11 +159,10 @@ class UpgradeHelper(object):
orig_net_manager = orig_cluster.get_network_manager()
new_net_manager = new_cluster.get_network_manager()
vips = orig_net_manager.get_assigned_vips()
for ng_name in vips:
if ng_name not in (consts.NETWORKS.public,
consts.NETWORKS.management):
vips.pop(ng_name)
vips = {}
assigned_vips = orig_net_manager.get_assigned_vips()
for ng_name in (consts.NETWORKS.public, consts.NETWORKS.management):
vips[ng_name] = assigned_vips[ng_name]
# NOTE(akscram): In the 7.0 release was introduced networking
# templates that use the vip_name column as
# unique names of VIPs.