diff --git a/scripts/ipintutil b/scripts/ipintutil index 5eb1f66524..c61c622a87 100755 --- a/scripts/ipintutil +++ b/scripts/ipintutil @@ -193,9 +193,13 @@ def get_ip_intfs_in_namespace(af, namespace, display): return ip_intfs -def display_ip_intfs(ip_intfs): +def display_ip_intfs(ip_intfs,address_family): header = ['Interface', 'Master', 'IPv4 address/mask', 'Admin/Oper', 'BGP Neighbor', 'Neighbor IP'] + + if address_family == 'ipv6': + header[2] = 'IPv6 address/mask' + data = [] for ip_intf, v in natsorted(ip_intfs.items()): ip_address = v['ipaddr'][0][1] @@ -265,7 +269,7 @@ def main(): load_db_config() ip_intfs = get_ip_intfs(af, namespace, display) - display_ip_intfs(ip_intfs) + display_ip_intfs(ip_intfs,args.address_family) sys.exit(0) diff --git a/tests/show_ip_int_test.py b/tests/show_ip_int_test.py index 31350d3ea5..d2abdbbf5d 100644 --- a/tests/show_ip_int_test.py +++ b/tests/show_ip_int_test.py @@ -19,7 +19,7 @@ Vlan100 40.1.1.1/24 error/down N/A N/A""" show_ipv6_intf_with_multiple_ips = """\ -Interface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP +Interface Master IPv6 address/mask Admin/Oper BGP Neighbor Neighbor IP --------------- -------- -------------------------------------------- ------------ -------------- ------------- Ethernet0 2100::1/64 error/down N/A N/A aa00::1/64 N/A N/A @@ -36,7 +36,7 @@ PortChannel0001 20.1.1.1/24 error/down T2-Peer 20.1.1.5""" show_multi_asic_ipv6_intf = """\ -Interface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP +Interface Master IPv6 address/mask Admin/Oper BGP Neighbor Neighbor IP --------------- -------- -------------------------------------- ------------ -------------- ------------- Loopback0 fe80::60a5:9dff:fef4:1696%Loopback0/64 error/down N/A N/A PortChannel0001 aa00::1/64 error/down N/A N/A @@ -54,7 +54,7 @@ veth@eth2 193.1.1.1/24 error/down N/A N/A""" show_multi_asic_ipv6_intf_all = """\ -Interface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP +Interface Master IPv6 address/mask Admin/Oper BGP Neighbor Neighbor IP --------------- -------- -------------------------------------- ------------ -------------- ------------- Loopback0 fe80::60a5:9dff:fef4:1696%Loopback0/64 error/down N/A N/A PortChannel0001 aa00::1/64 error/down N/A N/A