Merge pull request #123 from 008agent/no_upgrade_no_revision_defined

Don't call upgrade callbacks for module with no revision defined
This commit is contained in:
Olof Hagsand 2020-07-28 12:41:19 +02:00 committed by GitHub
commit 6bd9306423
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -94,6 +94,7 @@ Expected: July 2020
### Corrected Bugs ### 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): * 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. * 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. * Fixed `CLICON_YANG_UNKNOWN_ANYDATA` for config and state data. This feature introduced in 4.5 didnt really work.

View file

@ -411,8 +411,10 @@ mod_ns_upgrade(clicon_handle h,
yspec = clicon_dbspec_yang(h); yspec = clicon_dbspec_yang(h);
if ((ymod = yang_find_module_by_namespace(yspec, ns)) == NULL) if ((ymod = yang_find_module_by_namespace(yspec, ns)) == NULL)
goto fail; goto fail;
if ((yrev = yang_find(ymod, Y_REVISION, NULL)) == NULL) 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) if (ys_parse_date_arg(yang_argument_get(yrev), &to) < 0)
goto done; goto done;
} }