Subject: [netmod] choices config statement

From: Balazs Lengyel <[email-masked]>
Date: Thu, 21 May 2009 10:06:59 +0200

Hello,
Is the following valid YANG?

        choice snack {
            config true;
            case sports-arena {
                config true;  // ???
                leaf pretzel { type int32; }
            }
            case late-night {
                leaf chocolate {
                    type string;
                    config false;   // ???
                }
            }
        }

By the way in '7.9.2.1. The case's Substatements' config is not listed as an allowed 
sub-statement while in '7.9.2.1. The case's Substatements' we have

"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, ..."

which implies that you can put config under a case node. One of them should be corrected.

Balazs

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 21 May 2009 21:33:19 +0200 (CEST)

> Is the following valid YANG?

No, config is not allowed under case.

> By the way in '7.9.2.1. The case's Substatements' config is not listed as an
> allowed sub-statement while in '7.9.2.1. The case's Substatements' we have
> 

The last sentence reads:

   If the parent node is a "case" node,
   the value is the same as the "case" node's parent "choice" node.

I.e. you inherit from the choice, not from case.

/martin