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

yang in CLICON_YANG_MAIN_DIR can't import module's in CLICON_YANG_DIR recursively #286

Closed
nowaits opened this issue Nov 10, 2021 · 1 comment
Labels

Comments

@nowaits
Copy link
Contributor

nowaits commented Nov 10, 2021

Hi olof,
The feature of recursive searching did not work with CLICON_YANG_MAIN_DIR.
my config is example.xml

<clixon-config xmlns="http://clicon.org/config">
  <CLICON_FEATURE>ietf-netconf:*</CLICON_FEATURE>
  <CLICON_FEATURE>clixon-restconf:fcgi</CLICON_FEATURE>
  <CLICON_FEATURE>clixon-restconf:allow-auth-none</CLICON_FEATURE>

  <CLICON_YANG_DIR>{ROOT_DIR}/share/clixon</CLICON_YANG_DIR>
  <CLICON_YANG_DIR>{ROOT_DIR}/share/openconfig/models</CLICON_YANG_DIR>
  <CLICON_YANG_MAIN_DIR>{ROOT_DIR}/share/mgmt/modules</CLICON_YANG_MAIN_DIR>
  ...
</clixon-config>

example.yang in {ROOT_DIR}/share/mgmt/modules dir

module example {
    yang-version 1.1;
    namespace "http://www.ex.com";
    prefix ex;

    import openconfig-interfaces { prefix oc-if; }
}

When starting backend, get the following search error:

Nov 10 09:57:49: plugin_load_one retval:1
Nov 10 09:57:49: yang_parse_filename /home/dev/code/net-base/dist/script/../share/mgmt/modules/example.yang
Nov 10 09:57:49: yang_parse_module: 1034: Yang error: No yang files found matching "openconfig-interfaces" in the list of CLICON_YANG_DIRs: No such file or directory
Nov 10 09:57:49: clixon_backend: 41588 Terminated retval:-1
Nov 10 09:57:49: backend_terminate

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6f6eed0 in hist_exit () from /home/dev/code/net-base/dist/script/../lib/libcligen.so.5.4
Missing separate debuginfos, use: debuginfo-install libgcc-4.8.5-44.el7.x86_64 libstdc++-4.8.5-44.el7.x86_64
(gdb) bt
#0  0x00007ffff6f6eed0 in hist_exit () from /home/dev/code/net-base/dist/script/../lib/libcligen.so.5.4
#1  0x00007ffff6f4c6f1 in cligen_exit () from /home/dev/code/net-base/dist/script/../lib/libcligen.so.5.4
#2  0x00007ffff1848fab in backend_exit (h=0x606000000020) at /home/dev/code/net-base/mgmt/backend/main.c:296
#3  0x00007ffff7f34dbd in clixon_plugin_exit_one () from /home/dev/code/net-base/dist/script/../lib/libclixon.so.5
#4  0x00007ffff7f350cb in clixon_plugin_exit_all () from /home/dev/code/net-base/dist/script/../lib/libclixon.so.5
#5  0x00007ffff7f36cee in clixon_plugin_module_exit () from /home/dev/code/net-base/dist/script/../lib/libclixon.so.5
#6  0x000000000040781d in backend_terminate ()
#7  0x000000000040b0d3 in main ()
(gdb) 

The code commit id I tested is:

commit 52e63a14d0c324ae79d61223cf3d81d9f9f5faf0
Merge: a1fe080 02a5d97
Author: Olof Hagsand <olof@hagsand.se>
Date:   Tue Nov 9 10:07:44 2021 +0100

    Merge pull request #285 from krihal/feature_recursive_search
    
    Fix for issue #284, do recursive lookup when reading YANG files from directory
olofhagsand added a commit that referenced this issue Nov 10, 2021
…ANG_DIR recursively](#286)

Which was a PR for [Recursive search CLIXON_YANG_DIR](#284)
@olofhagsand
Copy link
Member

This should be fixed now, please verify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants