Fix processing of bits type#364
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Thanks for the PR! For me, LGTM. Still I would appreciate additional reviews from other contributors. |
|
This looks fine considering |
|
Hi @dthiele Could you please rebase now, the CI tests are fixed so this MR should look all green |
* Add a default of -1 to max(allowed_bits), to cover cases where allowed_bits is empty (e.g. in the absence of any position statements). This will yield an initial implicit position of 0. * allowed_bits is a dict. Take the maximum of its values. * Raise ValueError, if pos exceeds its bounds. * Add test case.
be04bc6 to
7705585
Compare
JoseIgnacioTamayo
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the fix.
Hi,
I experienced an issue when processing a
bitstype that containsbitstatements without anypositionstatements. The following error message is triggeed by theposition-less bit statements in theaccess-operations-typehere https://github.com/mbj4668/pyang/blob/efae923cff35eeb0b9f257903e08c5f6c9de7256/modules/ietf/ietf-netconf-acm.yang#L119This PR should fix the issue and adds a corresponding test. In particular:
max(allowed_bits), to cover cases whereallowed_bitsis empty (e.g. in the absence of any position statements). This will yield an initial implicitposof 0.allowed_bitsis a dict. Take the maximum of its values.posexceeds its bounds.