From 06597a071c454bcbfac487d2b43b932664366428 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Wed, 2 Dec 2020 18:19:09 -0600 Subject: ifupdown-ng NMSA: Don't attempt non-CIDR fixups ifupdown-ng's `ifparse` will always give a CIDR format address. --- ncserver/module/nms_ifupdownng.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'ncserver/module/nms_ifupdownng.py') diff --git a/ncserver/module/nms_ifupdownng.py b/ncserver/module/nms_ifupdownng.py index 252ab78..66f2d19 100644 --- a/ncserver/module/nms_ifupdownng.py +++ b/ncserver/module/nms_ifupdownng.py @@ -634,21 +634,7 @@ def list_addresses(iface: str) -> list: iface) return list() - # Per comment in lif_address_format_cidr, this is the right thing to do. - fallback_prefix = "24" - netmask = _find_one(iface, 'netmask') - if netmask: - net = ipaddress.IPv4Network('0.0.0.0/'+netmask) - fallback_prefix = str(net.prefixlen) - - addrs = _find_many(iface, 'address') - - def fixup(addr): - if '/' not in addr: - addr = addr + "/" + fallback_prefix - return addr - - return list(map(fixup, addrs)) + return _find_many(iface, 'address') def add_address(iface: str, _type, addr: str, prefix): -- cgit v1.2.3-60-g2f50