ydk-gen icon indicating copy to clipboard operation
ydk-gen copied to clipboard

No meta data for bits type defined in typedef statement

Open ygorelik opened this issue 5 years ago • 1 comments

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

  1. 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;
      }
    }
  }
  1. Generate bundle, which includes the specified yang file.
  2. 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_)
  1. 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.

ygorelik avatar Jun 28 '19 18:06 ygorelik

Applicable only to YDK-0.5.5 as 'bits' type is implemented in C++.

ygorelik avatar Jul 15 '19 23:07 ygorelik