Assert that all PHYs in the config also exist in VPP

This commit is contained in:
Pim van Pelt
2022-03-24 12:29:16 +00:00
parent 8129235031
commit e8e41098be
3 changed files with 23 additions and 1 deletions

7
vppcfg
View File

@ -57,9 +57,16 @@ def main():
logging.error("Configuration is not valid, bailing")
sys.exit(-2)
config_phys = validator.get_phys(cfg)
vpp = VPPApi()
vpp.readconfig()
if not vpp.phys_exist(config_phys):
logging.error("Not all PHYs in the config exist in VPP")
vpp.disconnect()
sys.exit(-3)
vpp.dump()
vpp.disconnect()
if __name__ == "__main__":