Fix get_common_node_group behavior

Now if common nodegroup has not been found for given nodes None as a
result is returned instead of default node group.

This directly affects procedure of VIP allocation as (e.g.) VIPs will
not be allocated when cluster does not have assigned nodes.

Tests updated accordingly

Change-Id: Iaa94453f3f98cc9238f9810aab7311ffabbfa8b7
Closes-Bug: #1549254
This commit is contained in:
Artem Roma 2016-02-25 19:45:50 +02:00 committed by Nikita Zubkov
parent a72d2f6862
commit e15ad4ab63
1 changed files with 5 additions and 1 deletions

View File

@ -107,6 +107,11 @@ class TestUpgradeHelperCloneCluster(base_tests.BaseCloneClusterTest):
self.public_net_data['ip_ranges'])
def test_copy_vips(self):
# save network information before node reassignment to seed cluster
# as after that no VIP will be allocated/serialized due to
# absence of assigned nodes for the source cluster
orig_nets = self.serialize_nets(self.src_cluster.cluster)
new_cluster = self.helper.clone_cluster(self.src_cluster, self.data)
# we have to move node to new cluster before VIP assignment
@ -117,7 +122,6 @@ class TestUpgradeHelperCloneCluster(base_tests.BaseCloneClusterTest):
self.helper.copy_vips(self.src_cluster, new_cluster)
orig_nets = self.serialize_nets(self.src_cluster.cluster)
new_nets = self.serialize_nets(new_cluster.cluster)
self.assertEqual(orig_nets["management_vip"],