diff options
Diffstat (limited to 'tests/topotests/lib/common_config.py')
| -rw-r--r-- | tests/topotests/lib/common_config.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py index 21ed47fc4b..fb82b50628 100644 --- a/tests/topotests/lib/common_config.py +++ b/tests/topotests/lib/common_config.py @@ -36,7 +36,7 @@ import sys import ConfigParser import traceback import socket -import ipaddr +import ipaddress from lib.topolog import logger, logger_config from lib.topogen import TopoRouter, get_topogen @@ -1066,10 +1066,10 @@ def generate_ips(network, no_of_ips): addr_type = validate_ip_address(start_ip) if addr_type == "ipv4": - start_ip = ipaddr.IPv4Address(unicode(start_ip)) + start_ip = ipaddress.IPv4Address(unicode(start_ip)) step = 2 ** (32 - mask) if addr_type == "ipv6": - start_ip = ipaddr.IPv6Address(unicode(start_ip)) + start_ip = ipaddress.IPv6Address(unicode(start_ip)) step = 2 ** (128 - mask) next_ip = start_ip @@ -1077,7 +1077,7 @@ def generate_ips(network, no_of_ips): while count < no_of_ips: ipaddress_list.append("{}/{}".format(next_ip, mask)) if addr_type == "ipv6": - next_ip = ipaddr.IPv6Address(int(next_ip) + step) + next_ip = ipaddress.IPv6Address(int(next_ip) + step) else: next_ip += step count += 1 @@ -2273,7 +2273,7 @@ def verify_rib( nh_found = False for st_rt in ip_list: - st_rt = str(ipaddr.IPNetwork(unicode(st_rt))) + st_rt = str(ipaddress.ip_network(unicode(st_rt))) _addr_type = validate_ip_address(st_rt) if _addr_type != addr_type: @@ -2469,7 +2469,7 @@ def verify_rib( nh_found = False for st_rt in ip_list: - st_rt = str(ipaddr.IPNetwork(unicode(st_rt))) + st_rt = str(ipaddress.ip_network(unicode(st_rt))) _addr_type = validate_ip_address(st_rt) if _addr_type != addr_type: |
