diff --git a/scripts/fast-reboot-dump.py b/scripts/fast-reboot-dump.py index eebb2a8a5e..3881e9f5f4 100644 --- a/scripts/fast-reboot-dump.py +++ b/scripts/fast-reboot-dump.py @@ -12,6 +12,7 @@ import syslog import traceback import ipaddress +from builtins import str #for unicode conversion in python2 ARP_CHUNK = binascii.unhexlify('08060001080006040001') # defines a part of the packet for ARP Request @@ -39,7 +40,7 @@ def generate_neighbor_entries(filename, all_available_macs): arp_output.append(obj) ip_addr = key.split(':')[2] - if ipaddress.ip_interface(ip_addr).ip.version != 4: + if ipaddress.ip_interface(str(ip_addr)).ip.version != 4: #This is ipv6 address ip_addr = key.replace(key.split(':')[0] + ':' + key.split(':')[1] + ':', '') neighbor_entries.append((vlan_name, mac, ip_addr)) @@ -232,7 +233,7 @@ def send_garp_nd(neighbor_entries, map_mac_ip_per_vlan): # send arp/ndp packets for vlan_name, dst_mac, dst_ip in neighbor_entries: src_if = map_mac_ip_per_vlan[vlan_name][dst_mac] - if ipaddress.ip_interface(dst_ip).ip.version == 4: + if ipaddress.ip_interface(str(dst_ip)).ip.version == 4: send_arp(sockets[src_if], src_mac_addrs[src_if], src_ip_addrs[vlan_name], dst_mac, dst_ip) else: send_ndp(sockets[src_if], src_mac_addrs[src_if], src_ip_addrs[vlan_name], dst_mac, dst_ip)