Merge branch 'develop' of https://github.com/clicon/clixon into develop

This commit is contained in:
Olof Hagsand 2017-05-07 16:15:11 +02:00
commit 9c4ac8678d
14 changed files with 368 additions and 66 deletions

View file

@ -632,7 +632,7 @@ from_client_delete_config(clicon_handle h,
"</rpc-error></rpc-reply>", clicon_err_reason);
goto ok;
}
if (xmldb_init(h, target) < 0){
if (xmldb_create(h, target) < 0){
cprintf(cbret, "<rpc-reply><rpc-error>"
"<error-tag>operation-failed</error-tag>"
"<error-type>protocol</error-type>"

View file

@ -159,7 +159,7 @@ db_reset(clicon_handle h,
{
if (xmldb_delete(h, db) != 0 && errno != ENOENT)
return -1;
if (xmldb_init(h, db) < 0)
if (xmldb_create(h, db) < 0)
return -1;
return 0;
}
@ -181,7 +181,7 @@ rundb_main(clicon_handle h,
cxobj *xt = NULL;
cxobj *xn;
if (xmldb_init(h, "tmp") < 0)
if (xmldb_create(h, "tmp") < 0)
goto done;
if (xmldb_copy(h, "running", "tmp") < 0){
clicon_err(OE_UNIX, errno, "file copy");
@ -538,7 +538,7 @@ main(int argc, char **argv)
else
if (db_reset(h, "running") < 0)
goto done;
if (xmldb_init(h, "candidate") < 0)
if (xmldb_create(h, "candidate") < 0)
goto done;
if (xmldb_copy(h, "running", "candidate") < 0)
goto done;
@ -562,7 +562,7 @@ main(int argc, char **argv)
}
/* If candidate does not exist, create it from running */
if (xmldb_exists(h, "candidate") != 1){
if (xmldb_init(h, "candidate") < 0)
if (xmldb_create(h, "candidate") < 0)
goto done;
if (xmldb_copy(h, "running", "candidate") < 0)
goto done;