mbj4668 / pyang

An extensible YANG validator and converter in python
ISC License
537 stars 344 forks source link

pyang validation for expanded i_children (i.e. `set_phase_i_children`) doesn't populate augments prior to reaching them. #881

Open wenovus opened 1 year ago

wenovus commented 1 year ago

If there are augments, then prior to validation iteration reaching it, an augmented node does not appear in the parent node. I think this might be a bug since it is unintuitive to plugin writers.

I didn't get a chance to create a replicating issue, but I did see this issue in our openconfig plugin using openconfig models: https://github.com/openconfig/oc-pyang/pull/54/files#diff-b9009a670813b4f2059da1df3ec89fa7650699e698a338fb5396ac21288d1218L910-L917

Where stmt.parent.i_children changed after validation reached the augmented nodes, which happened last and caused us to miss a style bug in the model which our plugin was intended to catch.

I saw this happening both when the checkers were added to reference_2, as well as in a new validation stage after it.