mbj4668 / pyang

An extensible YANG validator and converter in python
ISC License
537 stars 344 forks source link

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

Open AwTri opened 1 month ago

AwTri commented 1 month ago

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
          "
          ";
      }
    }
  }
}