Disabled key-value datastore; Removed mandatory requirements for BACKEND, NETCONF, RESTCONF and CLI dirs

This commit is contained in:
Olof hagsand 2017-11-19 18:04:23 +01:00
parent 13377da34e
commit 548ffd2da6
21 changed files with 64 additions and 55 deletions

View file

@ -140,7 +140,7 @@ usage(char *argv0, clicon_handle h)
" -1\t\tRun once and then quit (dont wait for events)\n"
" -u <path>\tConfig UNIX domain path / ip address (default: %s)\n"
" -P <file>\tPid filename (default: %s)\n"
" -s <mode>\tSpecify backend startup mode: none|startup|running|init (replaces -IRCc:r:\n"
" -s <mode>\tSpecify backend startup mode: none|startup|running|init (replaces -IRCr\n"
" -c <file>\tLoad extra xml configuration, but don't commit.\n"
#ifdef BACKEND_STARTUP_BACKWARD_COMPAT
" -I\t\tInitialize running state database\n"
@ -835,7 +835,8 @@ main(int argc, char **argv)
) < 0)
goto done;
#else
clicon_log(LOG_ERR, "Startup mode indefined. Specify option CLICON_STARTUP_MODE or specify -s option to clicon_backend.\n");
clicon_log(LOG_ERR, "Startup mode undefined. Specify option CLICON_STARTUP_MODE or specify -s option to clicon_backend.\n");
goto done;
#endif
}
else {

View file

@ -431,11 +431,9 @@ plugin_initiate(clicon_handle h)
return -1;
/* Then load application plugins */
if ((dir = clicon_backend_dir(h)) == NULL){
clicon_err(OE_PLUGIN, 0, "backend_dir not defined");
return -1;
}
if (backend_plugin_load_dir(h, dir) < 0)
dir = clicon_backend_dir(h);
/* If backend directory, load the backend plugisn */
if (dir && backend_plugin_load_dir(h, dir) < 0)
return -1;
return 0;

View file

@ -400,12 +400,6 @@ main(int argc, char **argv)
if (yang_spec_main(h, stdout, printspec) < 0)
goto done;
/* Check plugin directory */
if (clicon_cli_dir(h) == NULL){
clicon_err(OE_PLUGIN, 0, "clicon_cli_dir not defined");
goto done;
}
/* Create tree generated from dataspec. If no other trees exists, this is
* the only one.
*/

View file

@ -366,7 +366,9 @@ done:
/*! Load plugins within a directory
*/
static int
cli_plugin_load_dir(clicon_handle h, char *dir, cli_syntax_t *stx)
cli_plugin_load_dir(clicon_handle h,
char *dir,
cli_syntax_t *stx)
{
int i;
int ndp;
@ -452,10 +454,7 @@ cli_syntax_load (clicon_handle h)
return 0;
/* Format plugin directory path */
if ((plugin_dir = clicon_cli_dir(h)) == NULL){
clicon_err(OE_FATAL, 0, "clicon_cli_dir not set");
goto quit;
}
plugin_dir = clicon_cli_dir(h);
clispec_dir = clicon_clispec_dir(h);
clispec_file = clicon_option_str(h, "CLICON_CLISPEC_FILE");
@ -474,7 +473,7 @@ cli_syntax_load (clicon_handle h)
goto quit;
/* Then load application plugins */
if (cli_plugin_load_dir(h, plugin_dir, stx) < 0)
if (plugin_dir && cli_plugin_load_dir(h, plugin_dir, stx) < 0)
goto quit;
if (clispec_file){

View file

@ -286,8 +286,6 @@ static void
usage(clicon_handle h,
char *argv0)
{
char *netconfdir = clicon_netconf_dir(h);
fprintf(stderr, "usage:%s\n"
"where options are\n"
"\t-h\t\tHelp\n"
@ -298,7 +296,7 @@ usage(clicon_handle h,
"\t-S\t\tLog on syslog\n"
"\t-y <file>\tOverride yang spec file (dont include .yang suffix)\n",
argv0,
netconfdir
clicon_netconf_dir(h)
);
exit(0);
}

View file

@ -92,8 +92,9 @@ netconf_plugin_load(clicon_handle h)
char filename[MAXPATHLEN];
plghndl_t *handle;
/* If no DIR defined, then dont load plugins */
if ((dir = clicon_netconf_dir(h)) == NULL){
clicon_err(OE_PLUGIN, 0, "clicon_netconf_dir not defined");
retval = 0;
goto quit;
}

View file

@ -316,7 +316,7 @@ restconf_plugin_load(clicon_handle h)
char filename[MAXPATHLEN];
if ((dir = clicon_restconf_dir(h)) == NULL){
clicon_err(OE_PLUGIN, 0, "clicon_restconf_dir not defined");
retval = 0;
goto quit;
}
/* Get plugin objects names from plugin directory */

View file

@ -269,8 +269,6 @@ usage(clicon_handle h,
char *argv0)
{
char *restconfdir = clicon_restconf_dir(h);
fprintf(stderr, "usage:%s [options]\n"
"where options are\n"
"\t-h \t\tHelp\n"
@ -279,7 +277,7 @@ usage(clicon_handle h,
"\t-d <dir>\tSpecify restconf plugin directory dir (default: %s)\n"
"\t-y <file>\tOverride yang spec file (dont include .yang suffix)\n",
argv0,
restconfdir
clicon_restconf_dir(h)
);
exit(0);
}