pyang does not verify a default value for a leafref type based statements
- 主要语言
- Python
- 星标
- 0
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
描述
```
What steps will reproduce the problem?
pyang does not verify a default value for a leafref type based statement
(leaf/leaf-list, typedef, refine). There are four errors in attached module,
but pyang only detects one.
What is the expected output? What do you see instead?
An error, if the value does not match the leafref's target node typespec.
What version of the product are you using? On what operating system?
Latest svn code.
Please provide any additional information below.
pyang behaves this way, since validating a default value in PathTypeSpec relies
on presence of the "i_target_node" member. If this member is missing, the
PathTypeSpec.str_to_val method will return true. This is always the case for
leafrefs, since the phases of validation that handle default values are done
*before* the phase, that fills out "i_target_node". You should check leafref
leaf's default value *after* statements.v_reference_leaf_leafref(ctx, s) is
called.
Jernej
```
Original issue reported on code.google.com by `jernej.t...@gmail.com` on 4 Apr 2014 at 9:12
Attachments:
- [leafref-default@2014-04-04.yang](https://storage.googleapis.com/google-code-attachments/pyang/issue-107/comment-0/leafref-default@2014-04-04.yang)
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。