From e3d38cef19bbebee8e2a3ccb311a60bc1b6ad17c Mon Sep 17 00:00:00 2001 From: Volodymyr Shypyguzov Date: Tue, 19 Apr 2016 11:30:20 +0300 Subject: [PATCH] Fix update_network_cidr method subnet() method of netaddr.IPNetwork expects size of subnets to be returned so we should pass to it subnet of the smaller size, not 1 Change-Id: Id6b7e8e43419d224cc1c3202ffd253664245d5d4 Closes-Bug: #1571543 --- fuelweb_test/models/fuel_web_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fuelweb_test/models/fuel_web_client.py b/fuelweb_test/models/fuel_web_client.py index 69556dafc..800374877 100644 --- a/fuelweb_test/models/fuel_web_client.py +++ b/fuelweb_test/models/fuel_web_client.py @@ -2661,7 +2661,8 @@ class FuelWebClient(object): if network['name'] != network_name: continue old_cidr = netaddr.IPNetwork(str(network['cidr'])) - new_cidr = list(old_cidr.subnet(1))[0] + old_subnet_prefix = int(str(network['cidr']).split('/')[-1]) + new_cidr = list(old_cidr.subnet(old_subnet_prefix + 1))[0] assert_not_equal(old_cidr, new_cidr, 'Can\t create a subnet using default cidr {0} ' 'for {1} network!'.format(old_cidr, network_name))