This commit is contained in:
Olof Hagsand 2019-07-25 11:39:17 +00:00
parent e7b60619da
commit 5f7d011654
9 changed files with 66 additions and 27 deletions

View file

@ -369,6 +369,7 @@ example_extension(clicon_handle h,
char *modname;
yang_stmt *ymod;
yang_stmt *yc;
yang_stmt *yn = NULL;
ymod = ys_module(yext);
modname = yang_argument_get(ymod);
@ -376,9 +377,11 @@ example_extension(clicon_handle h,
if (strcmp(modname, "example") != 0 || strcmp(extname, "e4") != 0)
goto ok;
clicon_debug(1, "%s Enabled extension:%s:%s", __FUNCTION__, modname, extname);
if ((yc = ys_prune(ys, 0)) == NULL)
if ((yc = yang_find(ys, 0, NULL)) == NULL)
goto ok;
if ((yn = ys_dup(yc)) == NULL)
goto done;
if (yn_insert(yang_parent_get(ys), yc) < 0)
if (yn_insert(yang_parent_get(ys), yn) < 0)
goto done;
ok:
retval = 0;