How to use the pybatfish.question.bfq.unusedStructures function in pybatfish

To help you get started, we’ve selected a few pybatfish examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github networkop / arista-network-ci / tests / batfish / leaf-3.py View on Github external
def test_config_sanity(isFailed):
    logging.info("Progress: Searching for unused and undefined data structures")
    # Find all undefined data structures
    undefined = bfq.undefinedReferences().answer().frame()
    if len(undefined) >  0:
        logging.error("Found undefined data structures")
        logging.error(undefined)
        isFailed = True
    else:
        logging.info("No undefined data structures found")

    # Find all unused data structures
    unused = bfq.unusedStructures().answer().frame()
    if len(unused) >  0:
        logging.error("Found unused data structures")
        logging.error(unused)
        isFailed = True
    else:
        logging.info("No unused data structures found")

    return isFailed