robshakir / pyangbind

A plugin for pyang that creates Python bindings for a YANG model.
Other
204 stars 121 forks source link

Fix _is_config attribute for non-config containers #323

Closed fperrin closed 12 months ago

fperrin commented 1 year ago

Rebase of #222 over latest master. Dropped the UT change, and applied a review suggestion to use a temporary var to avoid fetching the same value twice. Original author is @nicolasmorini .

When a YANG definition of a container has the statement "config false;", the Python bindings generated for this container should have "is_config=False" in its init method, but it was not the case.

Containers nested in non-config containers correctly inherited the _is_config attribute from its parent.

Add two test cases to tests/config-false.

miguelbf-alb commented 12 months ago

Just faced this issue as well, thanks for the fix which would otherwise take me quite a bit of time! It'd be nice if it could get in