From cc0ec92638a75b0c85cea704ee6d499dd072fbea Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Sun, 13 Mar 2022 17:42:16 +0000 Subject: [PATCH] Bugfix - get correct parent MTU --- validator/interface.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/validator/interface.py b/validator/interface.py index faba4e2..b30525f 100644 --- a/validator/interface.py +++ b/validator/interface.py @@ -251,6 +251,7 @@ def get_mtu(yaml, ifname): return 1500 if no MTU was set on the sub-int or the parent.""" iface = get_by_name(yaml, ifname) parent_iface = get_parent_by_name(yaml, ifname) + try: return iface['mtu'] return parent_iface['mtu'] @@ -274,7 +275,7 @@ def validate_interfaces(yaml): msgs.append("interface %s does not exist in bondethernets" % ifname) result = False - iface_mtu = get_mtu(yaml, iface) + iface_mtu = get_mtu(yaml, ifname) iface_lcp = has_lcp(yaml, ifname) iface_address = has_address(yaml, ifname)