Skip to content

Commit

Permalink
Renamed custom constant to better reflect usage, fixed some vagrant p…
Browse files Browse the repository at this point in the history
…roblems
  • Loading branch information
olofhagsand committed Jul 28, 2023
1 parent 7577245 commit 836ec5d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
25 changes: 17 additions & 8 deletions include/clixon_custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
#define AUTOCLI_GROUPING_AUGMENT_SKIP
/*! Skip uses/grouping references for augment
*
* Consider YANG constructs such as:
* augment x{
* uses y;
* <nodes>
* }
* 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 YANG_GROUPING_AUGMENT_SKIP
4 changes: 2 additions & 2 deletions lib/src/clixon_yang_parse_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/vagrant/vagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions util/clixon_netconf_ssh_callhome_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -247,9 +246,6 @@ main(int argc,
case 'h':
usage(argv[0]);
break;
case 'D':
dbg++; /* not used */
break;
case 'f':
family = optarg;
break;
Expand Down

0 comments on commit 836ec5d

Please sign in to comment.