yang-scan


Nameyang-scan JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://gitlab.com/nso-developer/yang-scan
SummaryPyang plugin scanning YANG modules
upload_time2023-01-31 11:05:15
maintainer
docs_urlNone
author
requires_python
licenseApache-2.0
keywords yang
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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.


.. _pyang: https://github.com/mbj4668/pyang/
.. _drned-xmnr: https://github.com/NSO-developer/drned-xmnr




            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/nso-developer/yang-scan",
    "name": "yang-scan",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "YANG",
    "author": "",
    "author_email": "",
    "download_url": "",
    "platform": null,
    "description": "YANG scanner\n============\n\nOverview\n~~~~~~~~\n\nThis simple pyang_ plugin scans YANG modules for constructs that are likely to\ncause interoperability issues, especially when integrating with Cisco NSO.  The\nconstructs that it looks for are:\n\n* ``tailf:display-when`` used in a configuration node that refers operational\n  nodes.  Pyang checks this kind of reference for ``when`` or ``must``\n  statements, but not for this extension statement.  Operational nodes are not\n  part of the accessible data tree when checking references from configuration\n  node, so such ``tailf:display-when`` statement would cause the parent node to\n  be always hidden.\n\n  Note that this check works only if you use a recent version of pyang, it is\n  not supported with the version distributed with Cisco NSO.\n\n  tag: ``XPATH_REF_CONFIG_FALSE``\n\n* Duplicate prefixes. Two distinct YANG modules having the same prefix is not a\n  YANG standard violation, but orchestration or configuration management\n  systems may not be able to work with such modules.\n\n  tag: ``SCAN_DUPLICATE_PREFIXES``\n\n* ``tailf:hidden`` with any argument other than ``full``.  ``tailf:hidden\n  full`` hides the node from all interfaces, other arguments cause the node to\n  be hidden from interactive interfaces like CLI.  This may cause\n  interoperability issues, since some tools (like drned-xmnr_) use them.\n\n  tag: ``SCAN_HIDDEN``\n\nThe plugin generates a warning for each occurrence of such construct.  If\nneeded, warnings can be turned off via ``--ignore-error``.\n\n\nInstallation and running\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis is a pyang_ plugin, so pyang must be available (e.g. via ``pip install\npyang``).  With that, no installation is required, only clone the repository\nand use it like\n\n::\n\n    $ pyang --plugindir /path/to/repo/yang_scan -f yang-scan /modules/*.yang\n\nIf convenient, you may install the plugin to your python environment though:\n\n::\n\n   $ python setup.py install\n\nand the argument ``--plugindir`` is not necessary then.\n\nInstalling the plugin from PyPI coming soon.\n\nThe plugin is always run through pyang_, for running it please refer to its\ndocumentation or to ``pyang --help``.  Warnings generated by the plugin can be\nturned off using pyang's option ``--ignore-error <tag>``, where tag is one of\n``XPATH_REF_CONFIG_FALSE``, ``SCAN_DUPLICATE_PREFIXES``, or ``SCAN_HIDDEN``.\nNote that ignoring ``XPATH_REF_CONFIG_FALSE`` turns off warnings for ``when``\nand ``must`` statements too.\n\n\n.. _pyang: https://github.com/mbj4668/pyang/\n.. _drned-xmnr: https://github.com/NSO-developer/drned-xmnr\n\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Pyang plugin scanning YANG modules",
    "version": "1.1.0",
    "split_keywords": [
        "yang"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73f7db7c29471d98b299e697718d96f6d8079e21025347a9551bdab4f8db109a",
                "md5": "d2cc965ffdebe43cf9c1271aaa16df86",
                "sha256": "191bf8edab310da450e09abda2dbed82f3b86a23dce1bdc860c47c5eb9322c34"
            },
            "downloads": -1,
            "filename": "yang_scan-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d2cc965ffdebe43cf9c1271aaa16df86",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 12430,
            "upload_time": "2023-01-31T11:05:15",
            "upload_time_iso_8601": "2023-01-31T11:05:15.886633Z",
            "url": "https://files.pythonhosted.org/packages/73/f7/db7c29471d98b299e697718d96f6d8079e21025347a9551bdab4f8db109a/yang_scan-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-31 11:05:15",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "gitlab_user": "nso-developer",
    "gitlab_project": "yang-scan",
    "lcname": "yang-scan"
}
        
Elapsed time: 0.96177s