diff --git a/apps/cli/cli_generate.c b/apps/cli/cli_generate.c index bf0827a9..10de13e2 100644 --- a/apps/cli/cli_generate.c +++ b/apps/cli/cli_generate.c @@ -833,13 +833,16 @@ yang2cli_container(clicon_handle h, char *s; int hide = 0; int hide_oc = 0; + int exist = 0; char *opext = NULL; yang_stmt *ymod = NULL; - char **name; + if (ys_real_module(ys, &ymod) < 0) goto done; - if (yang_extension_value(ymod, "openconfig-extensions", "http://openconfig.net/yang/openconfig-ext", &opext) == 0) { + if (yang_extension_value(ymod, "openconfig-version", "http://openconfig.net/yang/openconfig-ext", &exist, NULL) < 0) + goto done; + if (exist) { if (strcmp(yang_argument_get(ys), "config") == 0){ hide_oc = 1; } diff --git a/test/test_cli_auto_genmodel.sh b/test/test_cli_auto_genmodel.sh index d883b6b6..7af005a1 100755 --- a/test/test_cli_auto_genmodel.sh +++ b/test/test_cli_auto_genmodel.sh @@ -81,7 +81,7 @@ module $APPNAME { } } container interfaces { - oc-ext:operational; + oc-ext:openconfig-version; list interface { key name; leaf name {