ydk-gen
ydk-gen copied to clipboard
No meta data for bits type defined in typedef statement
Current Behavior
When yang model contains typedef statement, which defines bits type, the generated bundle defines corresponding class, but its meta data is missing.
Steps to Reproduce
- Take yang model which contains typedef statement defining bits type. Example from ydktest-types.yang:
typedef Ydk-bits-type {
description "this is bits type value";
type bits {
bit disable-nagle {
position 0;
}
bit auto-sense-speed {
position 1;
}
}
}
- Generate bundle, which includes the specified yang file.
- Check that generated file ydktest_types.py contains definition of corresponding class:
class YdkBitsType(FixedBitsDict):
"""
YdkBitsType
this is bits type value
Keys are:- auto\-sense\-speed , disable\-nagle
"""
def __init__(self):
dictionary_ = {
'auto-sense-speed': False,
'disable-nagle': False,
}
pos_map_ = {
'auto-sense-speed': 1,
'disable-nagle': 0,
}
super().__init__(dictionary_, pos_map_)
- Check the meta data file _./_meta/ydktest_types.py, note that _meta_table is missing component _MetaInfoClass, which describes class YdkBitsType.
System Information
YDK-0.5.5 and 0.8.3.
Applicable only to YDK-0.5.5 as 'bits' type is implemented in C++.