summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-12-02 18:19:09 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-12-02 18:19:09 -0600
commit06597a071c454bcbfac487d2b43b932664366428 (patch)
tree30ecac8b7cd3979e25648c68838c9e578c85dd25
parent736962192220fdff60ed434654ecf561183806c5 (diff)
downloadnetconfapk-06597a071c454bcbfac487d2b43b932664366428.tar.gz
netconfapk-06597a071c454bcbfac487d2b43b932664366428.tar.bz2
netconfapk-06597a071c454bcbfac487d2b43b932664366428.tar.xz
netconfapk-06597a071c454bcbfac487d2b43b932664366428.zip
ifupdown-ng NMSA: Don't attempt non-CIDR fixups
ifupdown-ng's `ifparse` will always give a CIDR format address.
-rw-r--r--ncserver/module/nms_ifupdownng.py16
1 files changed, 1 insertions, 15 deletions
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):