[sysrepo-devel] loading two different yang file versions into sysrepo

Jakub Nadolski JNadolski at advaoptical.com
Wed Aug 23 08:12:18 UTC 2017


Hi Radek,


I just tested with libyang 0.13.47 and it works well, I am able to load almost all of my modules, thanks a lot for the quick help. I still have some problems with the modules where deviations are defined, but these are private company modules and I need to be sure before making them public. The behavior is strange, because there's no error, but sysrepoctl doesn't return, just hangs:


sysrepoctl -i --yang=mef-cfm-dev.yang
Installing a new module from file 'mef-cfm-dev.yang'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/mef-cfm-dev at 2017-07-26.yang'...
Resolving dependency: 'mef-cfm-dev' imports 'mef-cfm'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/mef-cfm at 2012-04-16.yang'...
Resolving dependency: 'mef-cfm' imports 'ietf-yang-types'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-yang-types at 2010-09-24.yang'...
Resolving dependency: 'mef-cfm' imports 'ietf-inet-types'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-inet-types at 2010-09-24.yang'...
Resolving dependency: 'mef-cfm-dev' imports 'mef-soam-fm'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/mef-soam-fm at 2012-04-16.yang'...
Resolving dependency: 'mef-soam-fm' imports 'mef-cfm'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/mef-cfm at 2012-04-16.yang'...
Resolving dependency: 'mef-cfm' imports 'ietf-yang-types'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-yang-types at 2010-09-24.yang'...
Resolving dependency: 'mef-cfm' imports 'ietf-inet-types'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-inet-types at 2010-09-24.yang'...
Resolving dependency: 'mef-soam-fm' imports 'ietf-yang-types'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-yang-types at 2010-09-24.yang'...
Resolving dependency: 'mef-cfm-dev' imports 'mef-soam-pm'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/mef-soam-pm at 2012-04-16.yang'...
Resolving dependency: 'mef-soam-pm' imports 'mef-cfm'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/mef-cfm at 2012-04-16.yang'...
Resolving dependency: 'mef-cfm' imports 'ietf-yang-types'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-yang-types at 2010-09-24.yang'...
Resolving dependency: 'mef-cfm' imports 'ietf-inet-types'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-inet-types at 2010-09-24.yang'...
Resolving dependency: 'mef-soam-pm' imports 'ietf-yang-types'...
Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-yang-types at 2010-09-24.yang'...

Nothing happens here until I cancel this command. Are there some logs when I can check what happens and why it hangs?


Regards,

Jakub

________________________________
From: Radek Krejčí <rkrejci at cesnet.cz>
Sent: Tuesday, August 22, 2017 3:57:57 PM
To: Jakub Nadolski; Michal Vaško
Cc: sysrepo-devel at sysrepo.org
Subject: Re: [sysrepo-devel] loading two different yang file versions into sysrepo

Hi Jakub,
the value " " for bits does not strictly follow the bits representation description from RFC, but in this case the parser should probably handle that in silence on its own (as it does even for other types). So, please, update libyang to 0.13.47 version, which should fix this issue.

Regards,
Radek


Dne 22.8.2017 v 15:19 Jakub Nadolski napsal(a):
>
> Hi Michal,
>
>
> This is standard one, from MEF - https://www.mef.net/Assets/Technical_Specifications/PDF/MEF_39.pdf
>
>
> Thanks,
>
> Jakub
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> *From:* Michal Vaško <mvasko at cesnet.cz>
> *Sent:* Tuesday, August 22, 2017 3:14:52 PM
> *To:* Jakub Nadolski
> *Cc:* sysrepo-devel at sysrepo.org
> *Subject:* Re: [sysrepo-devel] loading two different yang file versions into sysrepo
>
> Hello Jakub,
> could you please provide the module in question for us? If you do not want to publish it publicly, it would be great if you could send it to my private email at least. We want to examine the problem carefully and then decide whether to fix this error or really consider the value invalid.
>
> Regards,
> Michal
>
> On Tuesday, August 22, 2017 14:59 CEST, Jakub Nadolski <JNadolski at advaoptical.com> wrote:
>
> > Hi Michal,
> >
> >
> > Thanks for the quick answer. I tried --search-dir option and I was able to load mef-cfm.yang. The next problem I see is with loading mef-soam-fm.yang:
> >
> >
> > Installing a new module from file 'mef-soam-pm.yang'...
> > [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
> > [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
> > [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
> > [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
> > [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
> > [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
> > [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
> > [ERR] (srctl_ly_log_cb:500) libyang: Invalid value " " in "fake-default" element.
> > [ERR] (srctl_ly_log_cb:500) libyang: Module "mef-soam-pm" parsing failed.
> > Error: Unable to load the module by libyang.
> > Install operation failed.
> >
> > The invalid value " " is used as default value for some leafs with bits type. Is this could be libyang issue?
> >
> >
> > Thanks,
> >
> > Jakub
> >
> >
> > ________________________________
> > From: Michal Vaško <mvasko at cesnet.cz>
> > Sent: Tuesday, August 22, 2017 2:30:38 PM
> > To: Jakub Nadolski
> > Cc: sysrepo-devel at sysrepo.org
> > Subject: Re: [sysrepo-devel] loading two different yang file versions into sysrepo
> >
> > Hi Jakub,
> > do not install imported modules directly (unless you want to also implement that module or you want to use an identity from that module). If you install mef-cfm.yang or another module that imports some other modules, they are loaded only as imports (as long as they are found in searchpaths), which can have duplicate names (but must have different revisions). Try executing "sysrepoctl -l", it will show you the current status of conformance for each module loaded into sysrepo.
> >
> > Regards,
> > Michal
> >
> > On Tuesday, August 22, 2017 13:59 CEST, Jakub Nadolski <JNadolski at advaoptical.com> wrote:
> >
> > > Hi All,
> > >
> > >
> > > I am using standard yang module mef-cfm.yang which depends on the ietf-inet-types at 2010-09-24.yang. But for other modules in my system, I need ietf-inet-types at 2013-07-15.yang. When trying to load both modules to sysrepo and I got an error:
> > >
> > >
> > > sysrepoctl -i --yang=ietf-inet-types at 2010-09-24.yang
> > > Installing a new module from file 'ietf-inet-types at 2010-09-24.yang'...
> > > Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-inet-types at 2010-09-24.yang'...
> > > Skipping installation of data files for module 'ietf-inet-types'...
> > > Notifying sysrepo about the change...
> > > Install operation completed successfully.
> > >
> > > sysrepoctl -i --yang=ietf-inet-types at 2013-07-15.yang
> > > Installing a new module from file 'ietf-inet-types at 2013-07-15.yang'...
> > > Installing the YANG file to '/_path_/sysrepo/build/repository/yang/ietf-inet-types at 2013-07-15.yang'...
> > > [ERR] (md_insert_lys_module:1905) Module 'ietf-inet-types' is already implemented in revision '2010-09-24'.
> > > Error: Unable to insert the module into the dependency graph.
> > > Reverting the install operation...
> > > Deleted the schema file '/_path_/sysrepo/build/repository/yang/ietf-inet-types at 2013-07-15.yang'.
> > > Install operation failed.
> > >
> > > Currently, I know that Netconf client, MG Soft Browser, supports loading two versions of the same yang. Do you know if there's a way to solve this problem?
> > >
> > > Thanks in advance,
> > > Jakub
> > >
> > >
> >
> >
> >
>
>
>
>
>
> _______________________________________________
> sysrepo-devel mailing list
> sysrepo-devel at sysrepo.org
> http://lists.sysrepo.org/listinfo/sysrepo-devel

--
Radek Krejci
mobile  : +420 732 212 714
office  : +420 234 680 256
e-mail  : rkrejci at cesnet.cz
LinkedIn: http://www.linkedin.com/in/radekkrejci

CESNET, Association of Legal Entities
Zikova 4
160 00 Praha 6
Czech Republic


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sysrepo.org/archives/sysrepo-devel/attachments/20170823/003e1d51/attachment.html>


More information about the sysrepo-devel mailing list