diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2020-04-04 00:43:02 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2020-04-04 03:34:55 +0200 |
commit | b90204a8e99808378621e50f8e586e6eabb30b76 (patch) | |
tree | 1c9b73b4eabb8de2257c409dda4640738faf89c9 /lib/yang_translator.c | |
parent | Merge pull request #6149 from Spantik/route-map-yang (diff) | |
download | frr-b90204a8e99808378621e50f8e586e6eabb30b76.tar.xz frr-b90204a8e99808378621e50f8e586e6eabb30b76.zip |
lib, tools: silence harmless warnings in the northbound tools
Our two northbound tools don't have embedded YANG modules like the
other FRR binaries. As such, ly_ctx_set_module_imp_clb() shouldn't be
called when the YANG subsystem it being initialized by a northbound
tool. To make that possible, add a new "embedded_modules" parameter
to the yang_init() function to control whether libyang should look
for embedded modules or not.
With this fix, "gen_northbound_callbacks" and "gen_yang_deviations"
won't emit "YANG model X not embedded, trying external file"
warnings anymore.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/yang_translator.c')
-rw-r--r-- | lib/yang_translator.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/yang_translator.c b/lib/yang_translator.c index 341420eed..7dbb1f3f1 100644 --- a/lib/yang_translator.c +++ b/lib/yang_translator.c @@ -171,7 +171,7 @@ struct yang_translator *yang_translator_load(const char *path) RB_INSERT(yang_translators, &yang_translators, translator); /* Initialize the translator libyang context. */ - translator->ly_ctx = yang_ctx_new_setup(); + translator->ly_ctx = yang_ctx_new_setup(false); if (!translator->ly_ctx) { flog_warn(EC_LIB_LIBYANG, "%s: ly_ctx_new() failed", __func__); goto error; @@ -511,7 +511,7 @@ static unsigned int yang_module_nodes_count(const struct lys_module *module) void yang_translator_init(void) { - ly_translator_ctx = yang_ctx_new_setup(); + ly_translator_ctx = yang_ctx_new_setup(true); if (!ly_translator_ctx) { flog_err(EC_LIB_LIBYANG, "%s: ly_ctx_new() failed", __func__); exit(1); |