Subject: [YANG] new pyang errors

From: Andy Bierman <[email-masked]>
Date: Fri, 18 Jan 2008 09:14:04 -0800

Hi,

I notice the new version of pyang says it is
an error to have a mandatory leaf with a default.

I don't agree with this interpretation.
There is no other way to support an agent-supplied default.

  leaf foo {
    mandatory true;
    default 7;
    type int32;
  }

  leaf bar {
    mandatory false;
    default 7;
    type int32;
  }

The leaf 'foo' is created by the agent with the value 7
if the manager tries to set the <running/> config
without it.  Mandatory means it must be present in a
valid config, not that the manager must set some value.

The leaf 'bar' has an irrelevant default clause that
will never be used because the leaf is optional and
the agent will not create it.

I think the CLR is backwards, but none is really needed here at all.

Andy

_______________________________________________
YANG mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/yang