diff --git a/vppcfg/config/interface.py b/vppcfg/config/interface.py index f3e9a44..e3d097d 100644 --- a/vppcfg/config/interface.py +++ b/vppcfg/config/interface.py @@ -555,10 +555,10 @@ def validate_interfaces(yaml): result = False if not address.is_canonical(addr): canonical = address.get_canonical(addr) - msgs.append( - f"interface {ifname} IP address {addr} is not canonical, use {canonical}" + logger.warning( + f"interface {ifname} IP address {addr} is not canonical, using {canonical}" ) - result = False + iface["addresses"][iface["addresses"].index(addr)] = canonical if "l2xc" in iface: if has_sub(yaml, ifname): diff --git a/vppcfg/config/loopback.py b/vppcfg/config/loopback.py index ed0018e..cba1bc8 100644 --- a/vppcfg/config/loopback.py +++ b/vppcfg/config/loopback.py @@ -137,10 +137,10 @@ def validate_loopbacks(yaml): result = False if not address.is_canonical(addr): canonical = address.get_canonical(addr) - msgs.append( - f"loopback {ifname} IP address {addr} is not canonical, use {canonical}" + logger.warning( + f"loopback {ifname} IP address {addr} is not canonical, using {canonical}" ) - result = False + iface["addresses"][iface["addresses"].index(addr)] = canonical if "mac" in iface and mac.is_multicast(iface["mac"]): msgs.append( f"loopback {ifname} MAC address {iface['mac']} cannot be multicast" diff --git a/vppcfg/unittest/yaml/error-address1.yaml b/vppcfg/unittest/yaml/error-address1.yaml index b9645bd..2cadda4 100644 --- a/vppcfg/unittest/yaml/error-address1.yaml +++ b/vppcfg/unittest/yaml/error-address1.yaml @@ -5,8 +5,7 @@ test: - "interface .* IP address .* conflicts with another" - "sub-interface .* IP address .* conflicts with another" - "loopback .* IP address .* conflicts with another" - - "interface .* IP address .* is not canonical, use .*" - count: 15 + count: 14 --- interfaces: GigabitEthernet1/0/0: