mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-25 22:30:52 +00:00
lib: set change errmsg in sysrepo session
this will enable sysrepo based cli users to know what went wrong when config change fails Signed-off-by: ali-aqrabawi <aaqrabaw@okdanetworks.com>
This commit is contained in:
parent
a2caf2b5e1
commit
cfe1b5b684
@ -279,11 +279,12 @@ static int frr_sr_config_change_cb_prepare(sr_session_ctx_t *session,
|
|||||||
ret = nb_candidate_commit_prepare(context, candidate, NULL,
|
ret = nb_candidate_commit_prepare(context, candidate, NULL,
|
||||||
&transaction, false, false, errmsg,
|
&transaction, false, false, errmsg,
|
||||||
sizeof(errmsg));
|
sizeof(errmsg));
|
||||||
if (ret != NB_OK && ret != NB_ERR_NO_CHANGES)
|
if (ret != NB_OK && ret != NB_ERR_NO_CHANGES) {
|
||||||
flog_warn(
|
flog_warn(EC_LIB_LIBSYSREPO,
|
||||||
EC_LIB_LIBSYSREPO,
|
"%s: failed to prepare configuration transaction: %s (%s)",
|
||||||
"%s: failed to prepare configuration transaction: %s (%s)",
|
__func__, nb_err_name(ret), errmsg);
|
||||||
__func__, nb_err_name(ret), errmsg);
|
sr_session_set_error_message(session, errmsg);
|
||||||
|
}
|
||||||
|
|
||||||
if (!transaction)
|
if (!transaction)
|
||||||
nb_config_free(candidate);
|
nb_config_free(candidate);
|
||||||
|
Loading…
Reference in New Issue
Block a user