From 836ec5dde59449c9ebb227addfb145175bcb13e1 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Fri, 28 Jul 2023 16:56:08 +0200 Subject: [PATCH] Renamed custom constant to better reflect usage, fixed some vagrant problems --- include/clixon_custom.h | 23 ++++++++++++++++------- lib/src/clixon_yang_parse_lib.c | 4 ++-- test/vagrant/vagrant.sh | 2 +- util/clixon_netconf_ssh_callhome_client.c | 4 ---- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/include/clixon_custom.h b/include/clixon_custom.h index 8d583008..5e0158c5 100644 --- a/include/clixon_custom.h +++ b/include/clixon_custom.h @@ -158,16 +158,25 @@ #define PRETTYPRINT_INDENT 3 /*! Autocli uses/grouping references for top-level - * Exception of expand-grouping in clixon-autocli.yang + * + * Exception of expand-grouping=true in clixon-autocli.yang * If enabled do not expand-grouping if a yang uses is directly under module or submodule * Disabled does not work today and is temporary and for documentation */ #define AUTOCLI_GROUPING_TOPLEVEL_SKIP -/*! Autocli uses/grouping references for augment/uses - * Exception of expand-grouping in clixon-autocli.yang - * If enabled do not expand-grouping if a yang uses is directly under augment - * Disabled does not work today and is temporary and for documentation - * it is also a "layering vilation" since the grouping/augment code is in cli-independent libs +/*! Skip uses/grouping references for augment + * + * Consider YANG constructs such as: + * augment x{ + * uses y; + * + * } + * If enabled, do not include "uses y" in the augmentation at "x" AND mark all nodes with + * YANG_FLAG_GROUPING + * If disabled, include "uses y" in the augmentation AND do NOT mark expaneded nodes with + * YANG_FLAG_GROUPING. + * This affects the AUTOCLI expand-grouping=true behavior. + * Disabled does not work */ -#define AUTOCLI_GROUPING_AUGMENT_SKIP +#define YANG_GROUPING_AUGMENT_SKIP diff --git a/lib/src/clixon_yang_parse_lib.c b/lib/src/clixon_yang_parse_lib.c index 1cb94f89..90ae7e4e 100644 --- a/lib/src/clixon_yang_parse_lib.c +++ b/lib/src/clixon_yang_parse_lib.c @@ -279,7 +279,7 @@ yang_augment_node(clicon_handle h, childkey = yang_keyword_get(yc0); /* Only shemanodes and extensions */ if (!yang_schemanode(yc0) && childkey != Y_UNKNOWN -#ifndef AUTOCLI_GROUPING_AUGMENT_SKIP +#ifndef YANG_GROUPING_AUGMENT_SKIP && childkey != Y_USES #endif ) @@ -349,7 +349,7 @@ yang_augment_node(clicon_handle h, } if ((yc = ys_dup(yc0)) == NULL) goto done; -#ifdef AUTOCLI_GROUPING_AUGMENT_SKIP +#ifdef YANG_GROUPING_AUGMENT_SKIP /* cornercase: always expand uses under augment */ yang_flag_reset(yc, YANG_FLAG_GROUPING); #endif diff --git a/test/vagrant/vagrant.sh b/test/vagrant/vagrant.sh index 3338e297..d9d829aa 100755 --- a/test/vagrant/vagrant.sh +++ b/test/vagrant/vagrant.sh @@ -309,7 +309,7 @@ $sshcmd sudo ./yangmodels.sh # Run tests $sshcmd "(cd src/cligen/test; ./sum.sh)" -$sshcmd "(cd src/clixon/test; detail=true ./sum.sh)" +$sshcmd "(cd src/clixon/test; bash -c 'detail=true ./sum.sh')" # destroy vm #if $destroy; then diff --git a/util/clixon_netconf_ssh_callhome_client.c b/util/clixon_netconf_ssh_callhome_client.c index 54fdcd20..a4b610e0 100644 --- a/util/clixon_netconf_ssh_callhome_client.c +++ b/util/clixon_netconf_ssh_callhome_client.c @@ -235,7 +235,6 @@ main(int argc, struct sockaddr from = {0,}; socklen_t len; size_t sin_len; - int dbg = 0; uint16_t port = NETCONF_CH_SSH; int ss = -1; /* server socket */ int s = -1; /* accepted session socket */ @@ -247,9 +246,6 @@ main(int argc, case 'h': usage(argv[0]); break; - case 'D': - dbg++; /* not used */ - break; case 'f': family = optarg; break;