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.9.2.tar.gz
.
File metadata
- Download URL: net-contextdiff-0.9.2.tar.gz
- Upload date:
- Size: 27.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96d6052a34e942bf46b800b5d8e5b8b1c23635c8e10cf87ea68f1f3e29e098c8 |
|
MD5 | 23df621e39e9bbbd961af761195f9d7b |
|
BLAKE2b-256 | a50c336faedb0b6109ebe1c05ff517f64eda770aa05b250a7b144d78a0f0a0bf |
File details
Details for the file net_contextdiff-0.9.2-py3-none-any.whl
.
File metadata
- Download URL: net_contextdiff-0.9.2-py3-none-any.whl
- Upload date:
- Size: 29.8 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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8f0c10c70e12b95c84fb62440a14a6da08452d7f584571bc113eda6a05a880f |
|
MD5 | ea369112e9ac46234e5117e8039ccf08 |
|
BLAKE2b-256 | 0d8ef7f5276e829aafd3455d8646fb1604b714511eaa672fbfe95556c83fb852 |