Skip to content

Commit 6a8adc2

Browse files
committed
schema UPDATE include revision in err messages
1 parent 9e9d482 commit 6a8adc2

5 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/schema_features.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,8 @@ lys_set_features(struct lysp_module *pmod, const char **features)
605605
/* check that all the features exist */
606606
for (j = 0; features[j]; ++j) {
607607
if (!lysp_feature_find(pmod, features[j], strlen(features[j]), 0)) {
608-
LOGERR(pmod->mod->ctx, LY_EINVAL, "Feature \"%s\" not found in module \"%s\".", features[j], pmod->mod->name);
608+
LOGERR(pmod->mod->ctx, LY_EINVAL, "Feature \"%s\" not found in module \"%s@%s\".", features[j],
609+
pmod->mod->name, pmod->mod->revision ? pmod->mod->revision : "<none>");
609610
return LY_EINVAL;
610611
}
611612
}

src/tree_schema_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ lys_load_mod_from_clb_or_file(struct ly_ctx *ctx, const char *name, const char *
840840
}
841841

842842
if (!*mod && !mod_latest) {
843-
LOGVAL(ctx, NULL, LYVE_REFERENCE, "Loading \"%s\" module failed, not found.", name);
843+
LOGVAL(ctx, NULL, LYVE_REFERENCE, "Loading \"%s@%s\" module failed, not found.", name, revision ? revision : "<any>");
844844
return LY_ENOTFOUND;
845845
}
846846

tests/utests/schema/test_tree_schema_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ test_module(void **state)
9999
ly_in_free(in, 0);
100100
assert_int_equal(0, mod->implemented);
101101
assert_int_equal(LY_EINVAL, lys_set_implemented(mod, feats));
102-
CHECK_LOG_CTX("Feature \"invalid\" not found in module \"test\".", NULL, 0);
102+
CHECK_LOG_CTX("Feature \"invalid\" not found in module \"test@<none>\".", NULL, 0);
103103
assert_int_equal(LY_SUCCESS, lys_set_implemented(mod, NULL));
104104
assert_non_null(mod->compiled);
105105
assert_string_equal("test", mod->name);

tests/yanglint/interactive/searchpath.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test searchpath_clear {searchpath --clear} {
1818
-setup $ly_setup -cleanup $ly_cleanup -body {
1919
ly_cmd "searchpath $mdir"
2020
ly_cmd "searchpath --clear"
21-
ly_cmd_err "load modleaf" "Loading \"modleaf\" module failed, not found."
21+
ly_cmd_err "load modleaf" "Loading \"modleaf@<any>\" module failed, not found."
2222
}}
2323

2424
cleanupTests

tests/yanglint/non-interactive/disabled_searchdir.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set mdir $env(YANG_MODULES_DIR)
44

55
test disable_searchdir_twice {Unsuccessfully imports module due to -D -D} {
66
ly_cmd "$mdir/ietf-ip.yang"
7-
ly_cmd_err "-D -D $mdir/ietf-ip.yang" "Loading \"ietf-interfaces\" module failed."
7+
ly_cmd_err "-D -D $mdir/ietf-ip.yang" "Loading \"ietf-interfaces@<any>\" module failed."
88
} {}
99

1010
cleanupTests

0 commit comments

Comments
 (0)