forked from CESNET/libyang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schema compile UPDATE allow deviate-replace implicit properties
Fixes CESNET#2212
- Loading branch information
1 parent
ed27758
commit 2063f20
Showing
2 changed files
with
1 addition
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* @author Michal Vasko <[email protected]> | ||
* @brief Schema compilation of augments, deviations, and refines. | ||
* | ||
* Copyright (c) 2015 - 2021 CESNET, z.s.p.o. | ||
* Copyright (c) 2015 - 2024 CESNET, z.s.p.o. | ||
* | ||
* This source code is licensed under BSD 3-Clause License (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
|
@@ -1499,13 +1499,6 @@ lys_apply_deviate_replace(struct lysc_ctx *ctx, struct lysp_deviate_rpl *d, stru | |
AMEND_WRONG_NODETYPE("deviation", "replace", "mandatory"); | ||
} | ||
|
||
if (!(target->flags & LYS_MAND_MASK)) { | ||
LOGVAL(ctx->ctx, LY_VCODE_DEV_NOT_PRESENT, "replacing", "mandatory", | ||
d->flags & LYS_MAND_TRUE ? "mandatory true" : "mandatory false"); | ||
ret = LY_EVALID; | ||
goto cleanup; | ||
} | ||
|
||
target->flags &= ~LYS_MAND_MASK; | ||
target->flags |= d->flags & LYS_MAND_MASK; | ||
} | ||
|
@@ -1523,12 +1516,6 @@ lys_apply_deviate_replace(struct lysc_ctx *ctx, struct lysp_deviate_rpl *d, stru | |
AMEND_WRONG_NODETYPE("deviation", "replace", "min-elements"); | ||
} | ||
|
||
if (!(target->flags & LYS_SET_MIN)) { | ||
LOGVAL(ctx->ctx, LYVE_REFERENCE, "Invalid deviation replacing \"min-elements\" property which is not present."); | ||
ret = LY_EVALID; | ||
goto cleanup; | ||
} | ||
|
||
*num = d->min; | ||
} | ||
|
||
|
@@ -1545,12 +1532,6 @@ lys_apply_deviate_replace(struct lysc_ctx *ctx, struct lysp_deviate_rpl *d, stru | |
AMEND_WRONG_NODETYPE("deviation", "replace", "max-elements"); | ||
} | ||
|
||
if (!(target->flags & LYS_SET_MAX)) { | ||
LOGVAL(ctx->ctx, LYVE_REFERENCE, "Invalid deviation replacing \"max-elements\" property which is not present."); | ||
ret = LY_EVALID; | ||
goto cleanup; | ||
} | ||
|
||
*num = d->max; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters