Ensure that LCP names are globally unique (between interface/sub-interface/loopback/bridgedomain)
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import logging
|
||||
import validator.lcp as lcp
|
||||
|
||||
class NullHandler(logging.Handler):
|
||||
def emit(self, record):
|
||||
@ -29,5 +30,8 @@ def validate_loopbacks(yaml):
|
||||
if 'addresses' in iface and not 'lcp' in iface:
|
||||
msgs.append("loopback %s has an address but no LCP" % ifname)
|
||||
result = False
|
||||
if 'lcp' in iface and not lcp.is_unique(yaml, iface['lcp']):
|
||||
msgs.append("loopback %s does not have a unique LCP name %s" % (ifname, iface['lcp']))
|
||||
result = False
|
||||
|
||||
return result, msgs
|
||||
|
Reference in New Issue
Block a user