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

Uploaded Source

Built Distribution

net_contextdiff-0.10-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: net-contextdiff-0.10.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.2

File hashes

Hashes for net-contextdiff-0.10.tar.gz
Algorithm Hash digest
SHA256 8ca7733538891a268a9c6a3eab2b603ca534d5066c1b0258c33674f0181e6cf0
MD5 c6c31928279ae3414b400a9c8b96af6c
BLAKE2b-256 748a765808c782a3cea25398209a6f9f02002b8ca3f5b166d39f5192f3036e70

See more details on using hashes here.

File details

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

File metadata

  • Download URL: net_contextdiff-0.10-py3-none-any.whl
  • Upload date:
  • Size: 33.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.2

File hashes

Hashes for net_contextdiff-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 5cb2c2fc845a25e5e7777486cecfa27c1f935719f7a5fcf1a2823e31cdac51ae
MD5 330e5786793d4fca340475ae9d043a09
BLAKE2b-256 2fdaf0fb8bae7a4399dbfdb6c3661b17caa7ff5df712c13b618c8e9acb60fff6

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