From f0faf014f82212e4fa0bba10954605d9bfa23527 Mon Sep 17 00:00:00 2001 From: Ivan Kliuk Date: Sat, 5 Dec 2015 17:16:38 +0200 Subject: [PATCH] New VIP-related fields in the database * Add 'is_user_defined' field to 'ip_addrs' table. * Rename 'vip_type' field to 'vip_name' of table 'ip_addrs'. * Add 'vip_namespace' field to 'ip_addrs' table. * Copy vip namespaces from plugin table network roles to 'vip_namespace' field according to the unique vip name. * Add database migrations. * Add unit test for migrations. Change-Id: Ia3e1d7f6e08dbebcb182de75eeaf58ddf6be4a8d Partial-bug: #1482399 --- cluster_upgrade/upgrade.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cluster_upgrade/upgrade.py b/cluster_upgrade/upgrade.py index 5416463..6fe249f 100644 --- a/cluster_upgrade/upgrade.py +++ b/cluster_upgrade/upgrade.py @@ -135,11 +135,11 @@ class UpgradeHelper(object): renamed_vips = collections.defaultdict(dict) for ng_name, vips in six.iteritems(vips): ng_vip_rules = rename_vip_rules[ng_name] - for vip_type, vip_addr in six.iteritems(vips): - if vip_type not in ng_vip_rules: + for vip_name, vip_addr in six.iteritems(vips): + if vip_name not in ng_vip_rules: continue - new_vip_type = ng_vip_rules[vip_type] - renamed_vips[ng_name][new_vip_type] = vip_addr + new_vip_name = ng_vip_rules[vip_name] + renamed_vips[ng_name][new_vip_name] = vip_addr return renamed_vips @classmethod @@ -159,7 +159,7 @@ class UpgradeHelper(object): consts.NETWORKS.management): vips.pop(ng_name) # NOTE(akscram): In the 7.0 release was introduced networking - # templates that use the vip_type column as + # templates that use the vip_name column as # unique names of VIPs. if version.LooseVersion(orig_cluster.release.environment_version) < \ version.LooseVersion("7.0"):