summaryrefslogtreecommitdiff
path: root/lib/yang.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2018-11-16 11:13:48 -0200
committerRenato Westphal <renato@opensourcerouting.org>2018-11-26 13:07:40 -0200
commitf3e5b71cc1894cb0ca2b835d4e0902a0034e1948 (patch)
treef939929894e22b323612410f54de08d3f145506f /lib/yang.c
parent98d8359fe710f08753a337911b04612da5218b2b (diff)
lib: set YANG search directory when creating libyang context
Minor code simplification. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/yang.c')
-rw-r--r--lib/yang.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/yang.c b/lib/yang.c
index a7a50a46b0..6236dc5a66 100644
--- a/lib/yang.c
+++ b/lib/yang.c
@@ -609,13 +609,13 @@ void yang_init(void)
ly_log_options(LY_LOLOG | LY_LOSTORE);
/* Initialize libyang container for native models. */
- ly_native_ctx = ly_ctx_new(NULL, LY_CTX_DISABLE_SEARCHDIR_CWD);
+ ly_native_ctx =
+ ly_ctx_new(YANG_MODELS_PATH, LY_CTX_DISABLE_SEARCHDIR_CWD);
if (!ly_native_ctx) {
flog_err(EC_LIB_LIBYANG, "%s: ly_ctx_new() failed", __func__);
exit(1);
}
ly_ctx_set_module_imp_clb(ly_native_ctx, yang_module_imp_clb, NULL);
- ly_ctx_set_searchdir(ly_native_ctx, YANG_MODELS_PATH);
ly_ctx_set_priv_dup_clb(ly_native_ctx, ly_dup_cb);
/* Detect if the required libyang plugin(s) were loaded successfully. */