YANG scanner
Overview
This simple pyang plugin scans YANG modules for constructs that are likely to cause interoperability issues, especially when integrating with Cisco NSO. The constructs that it looks for are:
tailf:display-when used in a configuration node that refers operational nodes. Pyang checks this kind of reference for when or must statements, but not for this extension statement. Operational nodes are not part of the accessible data tree when checking references from configuration node, so such tailf:display-when statement would cause the parent node to be always hidden.
Note that this check works only if you use a recent version of pyang, it is not supported with the version distributed with Cisco NSO.
tag: XPATH_REF_CONFIG_FALSE
Duplicate prefixes. Two distinct YANG modules having the same prefix is not a YANG standard violation, but orchestration or configuration management systems may not be able to work with such modules.
tag: SCAN_DUPLICATE_PREFIXES
tailf:hidden with any argument other than full. tailf:hidden full hides the node from all interfaces, other arguments cause the node to be hidden from interactive interfaces like CLI. This may cause interoperability issues, since some tools (like drned-xmnr) use them.
tag: SCAN_HIDDEN
The plugin generates a warning for each occurrence of such construct. If needed, warnings can be turned off via --ignore-error.
Installation and running
This is a pyang plugin, so pyang must be available (e.g. via pip install pyang). With that, no installation is required, only clone the repository and use it like
$ pyang --plugindir /path/to/repo/yang_scan -f yang-scan /modules/*.yang
If convenient, you may install the plugin to your python environment though:
$ python setup.py install
and the argument --plugindir is not necessary then.
Installing the plugin from PyPI coming soon.
The plugin is always run through pyang, for running it please refer to its documentation or to pyang --help. Warnings generated by the plugin can be turned off using pyang’s option --ignore-error <tag>, where tag is one of XPATH_REF_CONFIG_FALSE, SCAN_DUPLICATE_PREFIXES, or SCAN_HIDDEN. Note that ignoring XPATH_REF_CONFIG_FALSE turns off warnings for when and must statements too.
Metadata
Release files for yang-scan 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yang_scan-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for yang_scan-1.1.0-py3-none-any.whl |
Release files / yang_scan-1.1.0-py3-none-any.whl
| Download URL | yang_scan-1.1.0-py3-none-any.whl |
|---|---|
| Size | 12.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
191bf8edab310da450e09abda2dbed82f3b86a23dce1bdc860c47c5eb9322c34
|
|
BLAKE2b-256 checksum How to use checksums |
73f7db7c29471d98b299e697718d96f6d8079e21025347a9551bdab4f8db109a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Security for yang-scan 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.