Allow BondEthernet to set MAC, and disallow interfaces to set their MAC if they are a bond member

This commit is contained in:
Pim van Pelt
2022-04-09 21:18:26 +00:00
parent 35edcff884
commit be36cc0ede
5 changed files with 40 additions and 1 deletions

View File

@ -422,6 +422,9 @@ def validate_interfaces(yaml):
if ifname.startswith("BondEthernet") and (None,None) == bondethernet.get_by_name(yaml, ifname):
msgs.append("interface %s does not exist in bondethernets" % ifname)
result = False
if ifname.startswith("BondEthernet") and 'mac' in iface:
msgs.append("interface %s is a member of bondethernet, cannot set MAC" % ifname)
result = False
if not 'state' in iface:
iface['state'] = 'up'