Add bridge-domain support.
Refactor validator main function to avoid 'interface' symbol clash. Add get_mtu() for interfaces, returns the sub-int's MTU or its parent's MTU, defaulting to 1500. Ensure MTU for all bridge-domain members is set to the same value. Ensure all bridge-domain members are L2 (have no LCP, have no address)
This commit is contained in:
@ -12,10 +12,10 @@ try:
|
||||
except ImportError:
|
||||
print("ERROR: install yamale manually: sudo pip install yamale")
|
||||
sys.exit(-2)
|
||||
from validator.loopback import loopback
|
||||
from validator.bondethernet import bondethernet
|
||||
from validator.interface import interface
|
||||
from validator.bridgedomain import bridgedomain
|
||||
from validator.loopback import validate_loopbacks
|
||||
from validator.bondethernet import validate_bondethernets
|
||||
from validator.interface import validate_interfaces
|
||||
from validator.bridgedomain import validate_bridgedomains
|
||||
|
||||
from yamale.validators import DefaultValidators, Validator
|
||||
import ipaddress
|
||||
@ -79,25 +79,25 @@ class Validator(object):
|
||||
|
||||
self.logger.debug("Validating Semantics...")
|
||||
|
||||
rv, msgs = bondethernet(self.args, yaml)
|
||||
rv, msgs = validate_bondethernets(self.args, yaml)
|
||||
if msgs:
|
||||
ret_msgs.extend(msgs)
|
||||
if not rv:
|
||||
ret_rv = False
|
||||
|
||||
rv, msgs = interface(self.args, yaml)
|
||||
rv, msgs = validate_interfaces(self.args, yaml)
|
||||
if msgs:
|
||||
ret_msgs.extend(msgs)
|
||||
if not rv:
|
||||
ret_rv = False
|
||||
|
||||
rv, msgs = loopback(self.args, yaml)
|
||||
rv, msgs = validate_loopbacks(self.args, yaml)
|
||||
if msgs:
|
||||
ret_msgs.extend(msgs)
|
||||
if not rv:
|
||||
ret_rv = False
|
||||
|
||||
rv, msgs = bridgedomain(self.args, yaml)
|
||||
rv, msgs = validate_bridgedomains(self.args, yaml)
|
||||
if msgs:
|
||||
ret_msgs.extend(msgs)
|
||||
if not rv:
|
||||
|
Reference in New Issue
Block a user