Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No meta data for bits type defined in typedef statement #937

Open
ygorelik opened this issue Jun 28, 2019 · 1 comment
Open

No meta data for bits type defined in typedef statement #937

ygorelik opened this issue Jun 28, 2019 · 1 comment

Comments

@ygorelik
Copy link
Collaborator

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
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant