diff options
| author | Igor Ryzhov <idryzhov@gmail.com> | 2024-08-08 00:40:51 +0300 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2024-08-10 08:11:49 +0000 |
| commit | 06bf5bc161e6a8aff66e53a8ce5abbf2c3693325 (patch) | |
| tree | 32e18ef0a0a0d37ea12920278f7c7eb347dae1ab /mgmtd | |
| parent | 0cb334299c85d6a64bba55bcf00e136e0bbc6786 (diff) | |
mgmtd: don't add implicit state data when reading config from file
When mgmt reads configuration from file, it shouldn't add implicit state
data to the candidate datastore. Configuration datastores like candidate
should never store state, otherwise they fail validation.
Fixes #15814
Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
(cherry picked from commit 61e8d5e0b9f0ccb7647a04974f7134ede67fedd8)
Diffstat (limited to 'mgmtd')
| -rw-r--r-- | mgmtd/mgmt_ds.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mgmtd/mgmt_ds.c b/mgmtd/mgmt_ds.c index eaf52dfb29..dabae4afd1 100644 --- a/mgmtd/mgmt_ds.c +++ b/mgmtd/mgmt_ds.c @@ -127,7 +127,8 @@ static int mgmt_ds_load_cfg_from_file(const char *filepath, *dnode = NULL; ret = lyd_parse_data_path(ly_native_ctx, filepath, LYD_JSON, - LYD_PARSE_STRICT, 0, dnode); + LYD_PARSE_NO_STATE | LYD_PARSE_STRICT, + LYD_VALIDATE_NO_STATE, dnode); if (ret != LY_SUCCESS) { if (*dnode) |
