Subject: [netmod] YANG errors, 12.2, 12.3

From: Andy Bierman <[email-masked]>
Date: Mon, 20 Oct 2008 09:51:04 -0700

Hi,

I do not agree with the text in 12.2 and 12.3 that says the
too-many-elements and too-few-elements are generated once
per list node (should also mention leaf-list node).

This is an implementation CLR.

IMO, it would be better to identify the nodes that are
causing the error.  In code, it is natural to generate
the error when each child count (list or leaf-list)
is checked against the parent.  I prefer to generate
one <rpc-error> for each child object that caused
the error, and identify it with a 'bad-element'
in the error-info.

The errors in 12.2 and 12.3 should work the same as the
unique error in 12.1.  The agent MUST report at least
one instance, and MAY choose to report more instances
of these errors for the same parent node (identified
in the error-path).

Andy

_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 20 Oct 2008 18:54:46 +0200 (CEST)

Andy Bierman <[email-masked]> wrote:
> causing the error. 

How do you know which nodes are causing the error in a <commit/> or
<validate/>?

/martin

---

From: Andy Bierman <[email-masked]>
Date: Mon, 20 Oct 2008 10:19:28 -0700

> How do you know which nodes are causing the error in a <commit/> or

I see what you mean.  These errors are specialized for
the min-elements and max-elements clauses, which appear
in the list or leaf-list definition.  The term 'child nodes'
in those sections is misleading.  You mean the list or leaf-list
node.  There is no parent, no child -- just sibling nodes.

I think these errors also apply to a missing mandatory leaf
(too-few-elements) or extra instances of a leaf (too-many-elements).
In that case, the error-path should identify the missing
child (1 error), or any instance of an extra child (1 error).

So I was wrong -- the current text is OK for min/max elements.
But what about expanding it to cover these other 2 cases?

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 20 Oct 2008 21:04:28 +0200 (CEST)

Andy Bierman <[email-masked]> wrote:
> (too-few-elements)

I'm using the standard 'missing-element' for this one.

> or extra instances of a leaf (too-many-elements).

Hmm... how would such a leaf be created?  A 'create' operation on a
leaf that already exists will fail with 'data-exists'.

/martin

---

From: Andy Bierman <[email-masked]>
Date: Mon, 20 Oct 2008 12:22:23 -0700

> I'm using the standard 'missing-element' for this one.

me too

> leaf that already exists will fail with 'data-exists'.

if duplicate leafs are in the edit-config 'create', and
no leaf exists in the target config.

IMO, this is also something that the candidate does
not have to check until the <commit> is done.

Andy