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

Mandatory leaf in augmented container #840

Open
ahuangfeng opened this issue Jan 12, 2023 · 0 comments
Open

Mandatory leaf in augmented container #840

ahuangfeng opened this issue Jan 12, 2023 · 0 comments

Comments

@ahuangfeng
Copy link

I am trying to augment a notification container with a grouping having a mandatory leaf in it.
From the spec in rfc7950#section-7.17 I understand that it is valid if the container is not a configuration container but I am having an error out of pyang:

ahuangfeng@Alex-book [~/yang-examples] % pyang issue-yang2.yang -f tree -p .
issue-yang2.yang:21 (at issue-yang2.yang:16): error: cannot augment with mandatory node "new-leaf"
module: issue-yang2

  augment /iy:first-container:
    +--ro new-leaf    string

I also checked with NETMOD WG that mandatory leaves were allowed in augmented YANG modules unless they are config containers :
https://mailarchive.ietf.org/arch/msg/netmod/kH-zwf7rA5pLcMA3mLLsobM1ZfU/

Therefore I understand that this is a bug on augmented notification containers.

Here the two YANGs I used:

module issue-yang {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:issue-yang";
  prefix iy;

  container first-container {
    config false;

    leaf address {
      type string;
    }
    leaf port {
      type uint8;
    }
  }
}

And the second YANG module

module issue-yang2 {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:issue-yang2";
  prefix iyy;

  import issue-yang {
    prefix iy;
    reference
      "RFC XXXX: YYYY";
  }

  grouping second-container {
    leaf new-leaf {
      type string;
      config false;
      mandatory true;
    }
  }

  augment "/iy:first-container" {
    uses iyy:second-container;
  }
}

Validating:

$ pyang issue-yang2.yang -f tree -p .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant