Refactor phys_exist() into phys_exist_in_{config,vpp}(); Correct vppapi.get_phys()

This commit is contained in:
Pim van Pelt
2022-03-26 23:07:49 +00:00
parent 4c31541b3e
commit 176fd297aa
3 changed files with 20 additions and 6 deletions

7
vppcfg
View File

@ -18,7 +18,6 @@ import sys
import yaml
import logging
from config import Validator
import config.interface as interface
from vpp.reconciler import Reconciler
try:
@ -63,10 +62,14 @@ def main():
if not r.vpp_readconfig():
sys.exit(-3)
if not r.phys_exist(interface.get_phys(cfg)):
if not r.phys_exist_in_vpp():
logging.error("Not all PHYs in the config exist in VPP")
sys.exit(-4)
if not r.phys_exist_in_config():
logging.error("Not all PHYs in VPP exist in the config")
sys.exit(-5)
failed = False
if not r.prune():
if not args.force: