From 8b5c77838b3299ff3e9c5c89a2a4a319651b4e2e Mon Sep 17 00:00:00 2001 From: Vladimir Ratnikov Date: Tue, 28 Jul 2020 05:52:07 -0400 Subject: [PATCH] Don't call upgrade callbacks for module with no revision defined --- CHANGELOG.md | 1 + lib/src/clixon_yang_module.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e05edb1..c0b053e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,6 +94,7 @@ Expected: July 2020 ### Corrected Bugs +* Fixed: Don't call upgrade callbacks if no revision defined so there's no way to determine right way 'from' and 'to' * Fixed: [Need to add the possibility to use anchors around patterns #51](https://github.com/clicon/cligen/issues/51): * Dont escape `$` if it is last in a regexp in translation from XML to POSIX. * Fixed `CLICON_YANG_UNKNOWN_ANYDATA` for config and state data. This feature introduced in 4.5 didnt really work. diff --git a/lib/src/clixon_yang_module.c b/lib/src/clixon_yang_module.c index 52676d73..5e020a3f 100644 --- a/lib/src/clixon_yang_module.c +++ b/lib/src/clixon_yang_module.c @@ -412,7 +412,8 @@ mod_ns_upgrade(clicon_handle h, if ((ymod = yang_find_module_by_namespace(yspec, ns)) == NULL) goto fail; if ((yrev = yang_find(ymod, Y_REVISION, NULL)) == NULL) - goto fail; + retval = 1; + goto done; if (ys_parse_date_arg(yang_argument_get(yrev), &to) < 0) goto done; }