akarneliuk / pygnmi

The pure Python implementation of the gNMI client.
https://training.karneliuk.com
BSD 3-Clause "New" or "Revised" License
129 stars 44 forks source link

Support keys with no value in gnmi_path_generator #100

Closed jamie01 closed 2 years ago

jamie01 commented 2 years ago

This is valid where there are multiple keys and not all are mandatory, as is the case in ietf-alarms.yang for alarm-type-qualifier

This was previously accepted prior to the rework of the gnmi_path_generator function. I've added a unit-test along with the change, and ensured existing tests still pass.

For a bit more context on this specific case, since I originally thought it wasn't valid to have an empty key, someone else had the same question and outlines the specific part of the model: https://discuss.tail-f.com/t/how-to-access-list-element-on-the-key-which-is-empty/3602