diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-12-02 18:19:09 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-12-02 18:19:09 -0600 |
commit | 06597a071c454bcbfac487d2b43b932664366428 (patch) | |
tree | 30ecac8b7cd3979e25648c68838c9e578c85dd25 /ncserver | |
parent | 736962192220fdff60ed434654ecf561183806c5 (diff) | |
download | netconfapk-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.
Diffstat (limited to 'ncserver')
-rw-r--r-- | ncserver/module/nms_ifupdownng.py | 16 |
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): |