Skip to content

Commit

Permalink
Loosen yang namespace sanity check to warning
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed Jun 29, 2024
1 parent 68bf762 commit 803da7b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/src/clixon_yang_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,15 +891,11 @@ yang_lib2yspec(clixon_handle h,
if (yang_parse_module(h, name, revision, yspec, NULL) == NULL)
goto fail;
/* Sanity check: if given namespace differs from namespace in file */
if (ns != NULL) {
if ((ymod = yang_find(yspec, Y_MODULE, name)) != NULL) {
if ((ns2 = yang_find_mynamespace(ymod)) != NULL){
if (strcmp(ns, ns2) != 0){
clixon_err(OE_YANG, 0, "Module:%s namespace mismatch %s vs %s", name, ns, ns2);
goto fail;
}
}
}
if (ns != NULL &&
(ymod = yang_find(yspec, Y_MODULE, name)) != NULL &&
(ns2 = yang_find_mynamespace(ymod)) != NULL &&
strcmp(ns, ns2) != 0) {
clixon_log(h, LOG_WARNING, "Module:%s namespace mismatch %s vs %s", name, ns, ns2);
}
}
#ifdef YANG_SCHEMA_MOUNT_YANG_LIB_FORCE
Expand Down

0 comments on commit 803da7b

Please sign in to comment.