Closed apmanol closed 5 years ago
There is a half-undocumented option:
--dsdl-lax-yang-version
Try to translate modules with unsupported YANG
versions (use at own risk)
This will work for many 1.1 modules, but there are some constructs that it will not handle properly.
Indeed it fails in some cases. Should I report those cases, or wait for some solution someday?
Some YANG 1.1 changes would require massive work on the DSDL plugin. I have currently no capacity to do it, and I am not sure it is worth doing - other validating software is available.
Thanks for the feedback.
What other options exists for software validation? I would prefere to follow a path relative to some emacs setup.
Also I read some mail with reference to YANG-I-D but I believe this is mostly for the yang modules not the instances.
@apmanol may I ask what did you end up doing or which other software you picked? I'm having the same problem.
@Vafa-Andalibi unfortunately nothing, I didn't find any other option.
I did a 5-minute experiment and couldn't figure out how to correctly setup the search module paths so I give up with yanglint.
I think it's worth the effort. Here's an actual command that you might be able to adapt (I believe that you need to specify explicit paths for files specified on the command line, and that imported/included files will use the supplied search path):
% /usr/local/bin/yanglint \
--path=<IETF-YANG-LOCATION> --verbose --allimplemented \
--strict --type=config --merge --format=xml --default=all-tagged \
--output=ietf-interfaces.xml.out \
<IETF-YANG-LOCATION>/iana-if-type.yang \
<OTHER-YANG-LOCATION>/ietf-bulk-data-export.yang \
<OTHER-YANG-LOCATION>/ietf-ipfix.yang \
<OTHER-YANG-LOCATION>/ietf-psamp.yang \
ietf-interfaces.xml
Thank you @wlupton and @apmanol for your prompt reply, I tried yangint
and it seems to be doing the job well:
$ yanglint ../mud_yangs/ietf-mud@2019-01-28.yang ./luminaire.json
$ echo $?
0
Then after introducing some faults in the file:
$ yanglint ../mud_yangs/ietf-mud@2019-01-28.yang ./luminaire.json
err : Unknown element "ipv8". (/ietf-access-control-list:acls/acl[name='mud-21966-v4fr']/aces/ace[name='loc0-frdev']/matches)
@wlupton Thanks for tip!
Hello yang gurus,
I was trying to follow the advises for instance validation but I got the following error:
DSDL plugin supports only YANG version 1
When I tried to create the DSDL schema. Is there any workaround for this limitation? The module tested requires
yang-version 1.1;
(actually I want to used for the emacs setup)Thanks a lot!