Only loop over loopbacks if they are present in the config

This commit is contained in:
Pim van Pelt
2022-03-13 10:30:06 +00:00
parent 8a7c2f8b7c
commit 61b6c01e73

View File

@ -20,7 +20,10 @@ def loopback(args, yaml):
logger = logging.getLogger('vppcfg.validator')
logger.addHandler(NullHandler())
if not 'loopbacks' in yaml:
return result, msgs
logger.debug("Validating loopbacks...")
for ifname, iface in yaml['loopbacks'].items():
logger.debug("loopbacks %s" % iface)
logger.debug("loopback %s" % iface)
return result, msgs