Subject: [netmod] order of modules

From: Johan Rydberg <[email-masked]>
Date: Tue, 04 Nov 2008 09:06:44 +0100

I haven't read every word of the yang I-D but at least so far
I have not found anything stating the order of elements in the
schema tree.

In which order modules are loaded effect the final schema tree,
so my question is; what order should they be loaded in?

Take the following (stripped example):

module services {
   prefix serv;
   container services {
   }
}

module ssh {
   prefix ssh;
   augment /serv:services {
     container ssh {
       ...
     }
   }
}

module ftp {
   prefix ftp;
   augment /serv:services {
     container ftp {
       ...
     }
   }
}

The following snippet will only validate correctly if the ssh
module was loaded prior to the ftp module:

   <serv:services>
     <ssh:ssh />
     <ftp:ftp />
   </serv:services>

The agent can of course load the modules in a predictable way,
but how will clients know how to construct the final schema tree
from list of schemas provided via <get-schema/> ?

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

---

From: Martin Bjorklund <[email-masked]>
Date: Tue, 04 Nov 2008 09:17:18 +0100 (CET)

> I have not found anything stating the order of elements in the

Section 7.15.2.  specifies the XML Encoding Rules for "augment".  It
says:

   When a node is augmented, the augmented child nodes are encoded after
   all normal child nodes.  If the node is augmented more than once, the
   blocks of augmented child nodes are sorted (in alphanumeric order)
   according to their namespace URI and name of the first child node in
   each block.

So in your example, assuming that the URI for ftp is < the URI for
ssh, the ftp node would be encoded before the ssh node.

/martin

---

From: Johan Rydberg <[email-masked]>
Date: Tue, 04 Nov 2008 09:29:57 +0100

> ssh, the ftp node would be encoded before the ssh node.

Perfect!  Thank you!  BTW, is this currently supported by pyang?

And related, any plans on updating pyang to support -02 (or -01)?

~jrydberg

---

From: Martin Bjorklund <[email-masked]>
Date: Tue, 04 Nov 2008 09:57:28 +0100 (CET)

> Perfect!  Thank you!  BTW, is this currently supported by pyang?

Hmm.. Not really... I will fix it.

> And related, any plans on updating pyang to support -02 (or -01)?

0.9.2 support -01, and I'm currently working on remaining -02
support.  I hope to release that this week or next.

/martin

---

From: Andy Bierman <[email-masked]>
Date: Tue, 04 Nov 2008 04:07:32 -0800

> module was loaded prior to the ftp module:

Every module (or submodule) lists all of its imports
and includes.  No matter what module you start with,
the imports and includes will identify the dependencies.

> from list of schemas provided via <get-schema/> ?

Why does the relative order of top-level sibling nodes matter?
The agent should accept any <config> element order.  There does
not need to be any forced order of modules within the <config>
element.

Andy