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

Pyang 2.6 error : node {::} is config false and not part of accessible tree #918

Open
AwTri opened this issue Sep 23, 2024 · 1 comment
Open

Comments

@AwTri
Copy link

AwTri commented Sep 23, 2024

Pyang 2.6.0/2.6.1 onwards we see that the yang files report warning for any when conditions set on a config false leaf as shown below. Why this is a warning for pyang, If we remove config false from the when condition leaf then the warning goes away. Also is there any way to mask this error.

NOTE: The feature supported may be config false based on different conditions and may not be configurable

pyang abc-example.yang
abc-example.yang:44: warning: node "abc-example::feature" is config false and is not part of the accessible tree

abc-example.yang:44: warning: node "abc-example::feature" is config false and is not part of the accessible tree
module: abc-example
  +--rw mycontainer
     +--rw mylist* [key1]
        +--rw key1                       uint32
        +--ro feature?                   boolean
        +--rw feature-dependent-value?   uint8

module abc-example {
  yang-version 1.1;
  namespace "urn:abc:mgmt:example";
  prefix example;

  organization
    "abc";
  contact
    "";
  description
    "";
  revision 2021-03-16 {
    description
      "
        Initial release
      ";
    reference "None";
  }

  container mycontainer {
    description
      " My container";
    list  mylist {
      key "key1";
      description
        "
        ";
      leaf key1 {
        type uint32;
        description
          "
            key
          ";
      }
      leaf feature {
        type boolean;
        config false;
        description
          "
            feature supported
          ";
      }
      leaf feature-dependent-value {
        when "../feature = 'true'";
        type uint8 {
          range "0..max";
        }
        description
          "
          ";
      }
    }
  }
}
@szabolcsszekely
Copy link

Hi, the feature-dependent-value leaf is a data node in the configuration datastores while the feature leaf is state data which is not part of the configuration datastores. The XPATH expression in the when statement is evaluated on the configuration datastores as it is defined on a configuration data node so the config false data node is not accessible for it.

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

2 participants