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.5.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

net_contextdiff-0.15.5-py3-none-any.whl (56.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for net-contextdiff-0.15.5.tar.gz
Algorithm Hash digest
SHA256 d24ca55d2c3f5baa6ad7e1db9eb756883e440a4aa3d8693f5d8539ed4535b0f7
MD5 78eff146bb22e0ad9e4ef665ab61b5e1
BLAKE2b-256 4876d5982602c867ca3651852fe9d43ba2fec49fa1e38e65d47b43f391c73ca0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for net_contextdiff-0.15.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1f0b6e7b12d8a12d5f5444f6d45392c1d56fd658ec54720aa015d047be635107
MD5 def6a66ca3711d3d78c5f5e4a4fc5940
BLAKE2b-256 339b495148be5ec07a3b29d80b0c1d1215588caf6703dd6087ec0bc408e60a8b

See more details on using hashes here.

Supported by

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