Subject: [yang-doctors] naive YANG question

From: "Joel M. Halpern" <[email-masked]>
Date: Tue, 13 Sep 2016 10:15:13 -0400

I was having a debate with a model co-author about whether to include an 
escape value in an enum.  The particular case is one where we know that 
tnew values in the enumeration will be needed.

But looking through the YANG spec, the only place I can find reference 
to adding values to an enumeration is when a model is revised.

Is there any way for a sub-module to add values to an enumeration?  I 
thought there was, but I am missing it when I look.

Thank you,
Joel

---

From: "Giles Heron (giheron)" <[email-masked]>
Date: Tue, 13 Sep 2016 15:13:18 +0000

I guess that’s where I’d generally vote for using an identity rather than an enum.

> On 13 Sep 2016, at 15:15, Joel M. Halpern <[email-masked]> wrote:
> 
> I was having a debate with a model co-author about whether to include an escape value in an enum.  The particular case is one where we know that tnew values in the enumeration will be needed.
> 
> But looking through the YANG spec, the only place I can find reference to adding values to an enumeration is when a model is revised.
> 
> Is there any way for a sub-module to add values to an enumeration?  I thought there was, but I am missing it when I look.
> 
> Thank you,
> Joel
> 
> _______________________________________________
> yang-doctors mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/yang-doctors

---

From: Andy Bierman <[email-masked]>
Date: Tue, 13 Sep 2016 09:21:46 -0700

Hi,

Submodules are merely a way to refactor statements into multiple files.
They represent one YANG module.  Submodules cannnot extend a data type
in a modular fashion like an external augment.  All submodules must be
listed in the main module.  There is no possibility of any conditionals in
the include-stmts to create multiple variants with different submodule
combinations.

Enums are static.  Use identityref if you want to add values from other
modules,
allowing variance in the supported value-set on each server.

Andy