Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Linting issues preventing matrix building docs from being successful #38

Open
FragmentedPacket opened this issue Feb 15, 2020 · 1 comment
Labels
bug Something isn't working documentation Documentation issue PR Required

Comments

@FragmentedPacket
Copy link
Contributor

Experiencing the following exception:

(test) myohman@myohman:/c/Users/myohman/Downloads/github/ntc-rosetta$ make docs
docker run -it --rm -p 8888:8888 -v /c/Users/myohman/Downloads/github/ntc-rosetta:/ntc_rosetta ntc_rosetta-3.6:latest \
        make _docs
cd docs && make html
make[1]: Entering directory '/ntc_rosetta/docs'
cp ../CHANGELOG.rst .
cp ../CONTRIBUTING.rst .
python build_supported_models.py
Traceback (most recent call last):
  File "build_supported_models.py", line 166, in <module>
    main()
  File "build_supported_models.py", line 153, in main
    r = RootLinter.lint(getattr(d, processor_type), dm, True, set())
  File "/usr/local/lib/python3.6/site-packages/yangify/linter/__init__.py", line 397, in lint
    res.children[child] = ContainerLinter.lint(child_obj, dm, recursive, ignore)
  File "/usr/local/lib/python3.6/site-packages/yangify/linter/__init__.py", line 277, in lint
    cls, dm, recursive, ignore
  File "/usr/local/lib/python3.6/site-packages/yangify/linter/__init__.py", line 334, in _process_children
    getattr(cls, child_name), dm, recursive, ignore
  File "/usr/local/lib/python3.6/site-packages/yangify/linter/__init__.py", line 277, in lint
    cls, dm, recursive, ignore
  File "/usr/local/lib/python3.6/site-packages/yangify/linter/__init__.py", line 334, in _process_children
    getattr(cls, child_name), dm, recursive, ignore
  File "/usr/local/lib/python3.6/site-packages/yangify/linter/__init__.py", line 277, in lint
    cls, dm, recursive, ignore
  File "/usr/local/lib/python3.6/site-packages/yangify/linter/__init__.py", line 334, in _process_children
    getattr(cls, child_name), dm, recursive, ignore
  File "/usr/local/lib/python3.6/site-packages/yangify/linter/__init__.py", line 257, in lint
    path = cls.Yangify.path
AttributeError: 'function' object has no attribute 'Yangify'

If you try and run make docs it errors out due to search = unneeded within the following file:
https://github.com/networktocode/ntc-rosetta/blob/develop/ntc_rosetta/parsers/openconfig/junos/openconfig_system/system.py#L27

We have unneeded defined in other models, but I'm wondering if it's due to the type of node that search is:

  grouping system-dns-config {
    description "DNS / resolver related configuration data";

    leaf-list search {
      type oc-inet:domain-name;
      ordered-by user;
      description
        "An ordered list of domains to search when resolving
        a host name.";
    }
  }

Here is the ascii_tree:

   +--rw dns
   |  +--rw config
   |  |  +--rw search* <domain-name(string)>
   |  +--rw host-entries
   |  |  +--rw host-entry* [hostname]
   |  |     +--rw config
   |  |     |  +--rw alias* <string>
   |  |     |  +--rw hostname? <string>
   |  |     |  +--rw ipv4-address* <ipv4-address(string)>
   |  |     |  +--rw ipv6-address* <ipv6-address(string)>
   |  |     +--rw hostname <leafref>
   |  |     +--ro state
   |  |        +--ro alias* <string>
   |  |        +--ro hostname? <string>
   |  |        +--ro ipv4-address* <ipv4-address(string)>
   |  |        +--ro ipv6-address* <ipv6-address(string)>
   |  +--rw servers
   |  |  +--rw server* [address]
   |  |     +--rw address <leafref>
   |  |     +--rw config
   |  |     |  +--rw address? <ip-address(union)>
   |  |     |  +--rw port? <port-number(uint16)>
   |  |     +--ro state
   |  |        +--ro address? <ip-address(union)>
   |  |        +--ro port? <port-number(uint16)>
   |  +--ro state
   |     +--ro search* <domain-name(string)>
@FragmentedPacket
Copy link
Contributor Author

@dbarrosop Would the appropriate fix for this to add a dummy class for leaf lists within Yangify?

e.g. yangify/parser/__init__.py

class UnneededLeafList(Parser):
    pass

OR

class UnneededLeafList(Parser):
    def Yangify(ParserData):
        pass

And then update the search to be search = UnneededLeafList?

I guess the other option is to just require and implement a class to parse those out, but I'm thinking of there are other use cases that it would be worth it to implement the above.

@FragmentedPacket FragmentedPacket added bug Something isn't working documentation Documentation issue PR Required labels Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Documentation issue PR Required
Projects
None yet
Development

No branches or pull requests

1 participant