Closed chaitu6 closed 1 year ago
Were you able to fix this? @chaitu6
@manujagobind It seems can be fixed by supply a name to JNCPlugin class
class JNCPlugin(plugin.PyangPlugin):
"""The plug-in class of JNC.
The methods of this class are invoked by pyang during initialization. The
emit method is of particular interest if you are new to writing plugins to
pyang. It is from there that the parsing of the YANG statement tree
emanates, producing the generated classes that constitutes the output of
this plug-in.
"""
name = "jnc"
Could someone also help me to bypass this issue and also a proper step to generate java class using jnc because it is not given in user manual. Please not I am using Windows 10.
Thanks
@manujagobind It seems can be fixed by supply a name to JNCPlugin class
class JNCPlugin(plugin.PyangPlugin): """The plug-in class of JNC. The methods of this class are invoked by pyang during initialization. The emit method is of particular interest if you are new to writing plugins to pyang. It is from there that the parsing of the YANG statement tree emanates, producing the generated classes that constitutes the output of this plug-in. """ name = "jnc"
In which file do you add this?
hi can any one please help me in generation java class from .yang file , i tried pyang with JNC but getting following error while executing command:
dataedge@ubuntu:~/sdnwork/JNC/examples/yang$ pyang -f jnc --jnc-output src/gen/simple yang/simple.yang
Usage: pyang [options] [
Validates the YANG module in
pyang: error: no such option: --jnc-output
i had put jnc pluging into yang plugin dir also
I would like to integrate jnc to pyang for java class generation. I added the jnc.py plug to pyang/plugins in pyang installation. And the executed setup.py file of pyang . Then tried the pyang -v command But am facing the following issue Traceback (most recent call last): File "/usr/local/bin/pyang", line 4, in
import('pkg_resources').run_script('pyang==1.7.3', 'pyang')
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 719, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1504, in run_script
exec(code, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/pyang-1.7.3-py2.7.egg/EGG-INFO/scripts/pyang", line 450, in
run()
File "/usr/local/lib/python2.7/dist-packages/pyang-1.7.3-py2.7.egg/EGG-INFO/scripts/pyang", line 169, in run
p.add_opts(optparser)
File "/usr/local/lib/python2.7/dist-packages/pyang-1.7.3-py2.7.egg/pyang/plugins/tree.py", line 46, in add_opts
if plugin.is_plugin_registered('restconf'):
File "/usr/local/lib/python2.7/dist-packages/pyang-1.7.3-py2.7.egg/pyang/plugin.py", line 59, in is_plugin_registered
if plugin.name == name:
AttributeError: 'JNCPlugin' object has no attribute 'name'
Please help me out.