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

deviation's default statements don't fully support leaf-lists (YANG 1.1) #756

Open
wenovus opened this issue Jul 23, 2021 · 0 comments
Open
Labels

Comments

@wenovus
Copy link

wenovus commented Jul 23, 2021

pyang 2.5.0

These are what I think are valid YANG 1.1, but rejected by pyang.

deviate add

  1 module leaf-list-default-deviate {
  2     yang-version "1.1";
  3
  4     prefix a;
  5     namespace "https://a.com";
  6
  7     typedef num-a {
  8       type decimal64 {
  9         fraction-digits 2;
 10         range "1..3.14|10|20..max";
 11       }
 12     }
 13
 14     leaf-list num {
 15       type num-a;
 16     }
 17
 18     deviation /num {
 19       deviate add {
 20         default "2";
 21         default "2.1";
 22       }
 23     }
 24 }
leaf-list-default-deviate.yang:21: error: unexpected keyword "default"
leaf-list-default-deviate.yang:21: error: the "default" property already exists in node "leaf-list-default-deviate::num"

deviate replace

  1 module leaf-list-default-deviate {
  2     yang-version "1.1";
  3
  4     prefix a;
  5     namespace "https://a.com";
  6
  7     typedef num-a {
  8       type decimal64 {
  9         fraction-digits 2;
 10         range "1..3.14|10|20..max";
 11       }
 12     }
 13
 14     leaf-list num {
 15       type num-a;
 16       default "3";
 17       default "3.1";
 18     }
 19
 20     deviation /num {
 21       deviate replace {
 22         default "2";
 23         default "2.1";
 24       }
 25     }
 26 }
leaf-list-default-deviate.yang:23: error: unexpected keyword "default"

deviate delete

  1 module leaf-list-default-deviate {
  2     yang-version "1.1";
  3
  4     prefix a;
  5     namespace "https://a.com";
  6
  7     typedef num-a {
  8       type decimal64 {
  9         fraction-digits 2;
 10         range "1..3.14|10|20..max";
 11       }
 12     }
 13
 14     leaf-list num {
 15       type num-a;
 16       default "3";
 17       default "3.1";
 18     }
 19
 20     deviation /num {
 21       deviate delete {
 22         default "3";
 23         default "3.1";
 24       }
 25     }
 26 }
leaf-list-default-deviate.yang:23: error: unexpected keyword "default"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants