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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file net-contextdiff-0.14.tar.gz
.
File metadata
- Download URL: net-contextdiff-0.14.tar.gz
- Upload date:
- Size: 41.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba25ef11f098793b689bf6416e715338dedd193e41067f9c47ded1610e4f9b14 |
|
MD5 | 8aaf51499c7100577f5bdea380318647 |
|
BLAKE2b-256 | f052da8909fef147166ed9e8f4802b0affd5a1f4a8171fad54d3e02632a5f6a9 |
File details
Details for the file net_contextdiff-0.14-py3-none-any.whl
.
File metadata
- Download URL: net_contextdiff-0.14-py3-none-any.whl
- Upload date:
- Size: 44.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb9c994fa3d4f25fd73a224b2241fd9f84897712c6ba8e36f8c96b2b77ef36af |
|
MD5 | 05da22888ee497833bbcc3751df8eebf |
|
BLAKE2b-256 | 53f82b4e5e40974274f904ae4537f9f3b488c631c42c1f5a0dc262f9168fc49a |