Subject: [netmod] Q about config-stmt processing

From: Andy Bierman <[email-masked]>
Date: Thu, 20 Jan 2011 09:19:31 -0800

Hi,

I have run into a YANG compiler difference between pyang and yangdump,
and I want the WG to decide which is right.

>From RFC 6020, sec 7.19.1:

  If "config" is not specified, the default is the same as the parent
   schema node's "config" value.  If the parent node is a "case" node,
   the value is the same as the "case" node's parent "choice" node.

   If the top node does not specify a "config" statement, the default is
   "true".

YANG example:

    grouping A {
       leaf a { type string; }
    }

    container foo {
      config false;
      uses A;
    }

    augment /foo {
      leaf b { type string; }
    }

In this example, yangdump says it is legal and pyang says it is not because /foo/b
is a config=true node.   Is /foo/b a config=true or a config=false node?
We need all conforming YANG compilers to agree on the answer.

The issue is the meaning of 'parent schema node' for a node within a top-level augment-stmt.
Is that node a top-level node?  IMO - no, because augment is specifying the parent schema node
for the contents of the augments.  Also, an inline leaf or a leaf via 'uses' should behave the same
way for the config-stmt property. (/foo/a is clearly config=false node)

Andy

---

From: Ladislav Lhotka <[email-masked]>
Date: Thu, 20 Jan 2011 18:37:15 +0100

> We need all conforming YANG compilers to agree on the answer.

IMO yangdump is correct here. Container "foo" should be considered the
schema tree parent for both leafs "a" and "b".

Lada

> 
>  
> 
> The issue is the meaning of ‘parent schema node’ for a node within a
> top-level augment-stmt.
> 
> Is that node a top-level node?  IMO – no, because augment is
> specifying the parent schema node
> for the contents of the augments.  Also, an inline leaf or a leaf via
> ‘uses’ should behave the same
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: Martin Bjorklund <[email-masked]>
Date: Tue, 25 Jan 2011 11:36:12 +0100 (CET)

> schema tree parent for both leafs "a" and "b".

I agree with both of you.  (and I have fixed the bug in pyang :)

/martin