Skip to main content

Compare network device configuration files using contextual structures

Project description

NET-CONTEXTDIFF

This package contains two main elements used to compare text-based configuration files (or other files in simple text in a similar format) where they are structured using indented blocks of directives/commands, typically for network devices:

  • a parser to read in configuration files and stored them in a dictionary -- the parser utilises the hierarchical nature of the configuration to understand that the same command name might mean different things in different contexts

  • a comparator that takes two configuration dictionaries (typically produced by the parser, above) - a source and a target configuration - and writes out a configuration file (or update command set) to transform the source configuration into the destination - this uses a series of 'converters' to handle the difference for each configuration element (e.g. changing the description assigned to an interface)

Each of these are written as abstract base classes that can be inherited from to crete concrete classes for each platform, but the base processing of the parsing and comparing should be consistent, requiring only the specific commands to be handled.

Currently, Cisco IOS is the only concrete platform and only a subset so far (the comparator is still being tweaked to handle this all relatively straightforwardly, before all the commands are implemented). There are currently some odd commands and edge cases which are awkward to handle without some improvements to the core process.

The scripts also support a system whereby 'excludes' can be specified, to exclude those elements of the configuration dictionary which should not be compared, if a known difference exists that cannot be resolved, either as an interim divergence, or a permanent exception.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

net-contextdiff-0.15.10.tar.gz (52.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

net_contextdiff-0.15.10-py3-none-any.whl (58.2 kB view details)

Uploaded Python 3

File details

Details for the file net-contextdiff-0.15.10.tar.gz.

File metadata

  • Download URL: net-contextdiff-0.15.10.tar.gz
  • Upload date:
  • Size: 52.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for net-contextdiff-0.15.10.tar.gz
Algorithm Hash digest
SHA256 84474aa38e281f45400ac2f244185d168804ac1ecd7a7379310ed47d602d4f15
MD5 c16c5912cf806636b8cf87de41009319
BLAKE2b-256 0f6b82cb74d73fb2f2da73f00d08078ad783938b3b9c21e5158fcb8a86361c19

See more details on using hashes here.

File details

Details for the file net_contextdiff-0.15.10-py3-none-any.whl.

File metadata

File hashes

Hashes for net_contextdiff-0.15.10-py3-none-any.whl
Algorithm Hash digest
SHA256 aba9a392fff16961849a9e376c856c07ba34e063bb7602e9b3cd18877ede7c1b
MD5 5df87f9b4ce0a84d208ecf331d40117e
BLAKE2b-256 876a41b97793592b56bae7085c91ddd07bd7fe7845987c7dfdafb885001f49cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page