Removed sending restconf config inline using -R when CLICON_BACKEND_RESTCONF_PROCESS=true
Define RESTCONF_INLINE to revert
This commit is contained in:
parent
fc73493881
commit
7352894c7e
3 changed files with 22 additions and 4 deletions
|
|
@ -46,6 +46,8 @@ Expected: October 2023
|
|||
|
||||
### Minor features
|
||||
|
||||
* Removed sending restconf config inline using -R when CLICON_BACKEND_RESTCONF_PROCESS=true
|
||||
* Define RESTCONF_INLINE to revert
|
||||
* Clarified clixon_cli command-line: `clixon_cli [options] [commands] [-- extra-options]`
|
||||
|
||||
### Corrected Bugs
|
||||
|
|
|
|||
|
|
@ -147,7 +147,6 @@ restconf_pseudo_set_inline(clicon_handle h,
|
|||
char **argv;
|
||||
int argc;
|
||||
int i;
|
||||
char *str = NULL;
|
||||
cxobj *xrestconf;
|
||||
cbuf *cb = NULL;
|
||||
|
||||
|
|
@ -158,6 +157,8 @@ restconf_pseudo_set_inline(clicon_handle h,
|
|||
for (i=0; i<argc; i++){
|
||||
if (argv[i] == NULL)
|
||||
break;
|
||||
#ifdef RESTCONF_INLINE
|
||||
char *str;
|
||||
if (strcmp(argv[i], "-R") == 0 && argc > i+1 && argv[i+1]){
|
||||
if ((cb = cbuf_new()) == NULL){
|
||||
clicon_err(OE_XML, errno, "cbuf_new");
|
||||
|
|
@ -175,6 +176,7 @@ restconf_pseudo_set_inline(clicon_handle h,
|
|||
argv[i+1] = str;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
retval = 0;
|
||||
done:
|
||||
|
|
@ -253,7 +255,10 @@ restconf_pseudo_process_control(clicon_handle h)
|
|||
struct stat fstat;
|
||||
int found = 0;
|
||||
|
||||
nr = 10;
|
||||
nr = 8; /* pgm -f <file> -D <dbg> -l <log> NULL */
|
||||
#ifdef RESTCONF_INLINE
|
||||
nr += 2;
|
||||
#endif
|
||||
if ((argv = calloc(nr, sizeof(char *))) == NULL){
|
||||
clicon_err(OE_UNIX, errno, "calloc");
|
||||
goto done;
|
||||
|
|
@ -307,8 +312,10 @@ restconf_pseudo_process_control(clicon_handle h)
|
|||
argv[i++] = "0";
|
||||
argv[i++] = "-l";
|
||||
argv[i++] = "s"; /* There is also log-destination in clixon-restconf.yang */
|
||||
#ifdef RESTCONF_INLINE
|
||||
argv[i++] = "-R";
|
||||
argv[i++] = "";
|
||||
argv[i++] = ""; /* The content is set in restconf_pseudo_set_inline */
|
||||
#endif
|
||||
argv[i++] = NULL;
|
||||
assert(i==nr);
|
||||
if (clixon_process_register(h, RESTCONF_PROCESS,
|
||||
|
|
@ -374,7 +381,7 @@ restconf_pseudo_process_commit(clicon_handle h,
|
|||
if (xpath_first(xtarget, NULL, "/restconf[enable='true']") != NULL)
|
||||
enabled++;
|
||||
/* Get debug flag of restconf config, set the restconf start -D daemon flag according
|
||||
* to it. The restconf daemon cannoit read its debug flag from config initially,
|
||||
* to it. The restconf daemon cannot read its debug flag from config initially,
|
||||
* but in this way it is set directly in its input args.
|
||||
* Its a trick.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -180,3 +180,12 @@
|
|||
* Disabled does not work
|
||||
*/
|
||||
#define YANG_GROUPING_AUGMENT_SKIP
|
||||
|
||||
/*! Start of restconf from backend (when CLICON_BACKEND_RESTCONF_PROCESS=true) using -R <inline>
|
||||
*
|
||||
* If set, send initial restconf config via -R <config> parameter at fork/exec.
|
||||
* Seems to be only an optimization since the config is queried from the backend anyway
|
||||
* The reason this probably should be undef:ed is that the restconf config appears in ps and other in
|
||||
* cleartext
|
||||
*/
|
||||
#undef RESTCONF_INLINE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue