Turn the non-canonical IPv6 address into a warning
This commit is contained in:
@@ -555,10 +555,10 @@ def validate_interfaces(yaml):
|
|||||||
result = False
|
result = False
|
||||||
if not address.is_canonical(addr):
|
if not address.is_canonical(addr):
|
||||||
canonical = address.get_canonical(addr)
|
canonical = address.get_canonical(addr)
|
||||||
msgs.append(
|
logger.warning(
|
||||||
f"interface {ifname} IP address {addr} is not canonical, use {canonical}"
|
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 "l2xc" in iface:
|
||||||
if has_sub(yaml, ifname):
|
if has_sub(yaml, ifname):
|
||||||
|
|||||||
@@ -137,10 +137,10 @@ def validate_loopbacks(yaml):
|
|||||||
result = False
|
result = False
|
||||||
if not address.is_canonical(addr):
|
if not address.is_canonical(addr):
|
||||||
canonical = address.get_canonical(addr)
|
canonical = address.get_canonical(addr)
|
||||||
msgs.append(
|
logger.warning(
|
||||||
f"loopback {ifname} IP address {addr} is not canonical, use {canonical}"
|
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"]):
|
if "mac" in iface and mac.is_multicast(iface["mac"]):
|
||||||
msgs.append(
|
msgs.append(
|
||||||
f"loopback {ifname} MAC address {iface['mac']} cannot be multicast"
|
f"loopback {ifname} MAC address {iface['mac']} cannot be multicast"
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ test:
|
|||||||
- "interface .* IP address .* conflicts with another"
|
- "interface .* IP address .* conflicts with another"
|
||||||
- "sub-interface .* IP address .* conflicts with another"
|
- "sub-interface .* IP address .* conflicts with another"
|
||||||
- "loopback .* IP address .* conflicts with another"
|
- "loopback .* IP address .* conflicts with another"
|
||||||
- "interface .* IP address .* is not canonical, use .*"
|
count: 14
|
||||||
count: 15
|
|
||||||
---
|
---
|
||||||
interfaces:
|
interfaces:
|
||||||
GigabitEthernet1/0/0:
|
GigabitEthernet1/0/0:
|
||||||
|
|||||||
Reference in New Issue
Block a user