Subject: [netmod] import-by-revision guidelines

From: Andy Bierman <[email-masked]>
Date: Sun, 22 Feb 2009 11:21:16 -0800

Hi,

I changed my mind about some elaborate scheme to pick
the 'best' revision if it is left out.  I think the draft
had it right the first time -- implementation-dependent.

   If revision specified in import/include:
      that exact revision must match
   Else:
      tool will find module in implementation-dependent manner

I plan to put a section in the YANG usage guidelines draft
about import-by-revision, but hopefully there will be
consensus on the details first.

Of course, standards-track modules MUST use revision dates,
but there are a lot of considerations for other types of
YANG modules.

The following applies to submodules/include as well.
There are 3 independent boolean variables:

importer: module with the import-stmt
   yes:
     import X { prefix x; revision 2009-01-01; }
   no:
     import X { prefix x; }

imported: module being imported
   yes:
     revision 2009-01-01 { description ""; }
   no:  // no revision-stmts

filename:
   yes:
      X.2009-01-01.yang
   no:
      X.yang

    +---------------------------------+--------+
    |  importer | imported | filename | result |
    +-----------+----------+----------+--------+
    |    no     |   no     |   no     |  (1)   |
    +-----------+----------+----------+--------+
    |    no     |   no     |   yes    |  (1)   |
    +-----------+----------+----------+--------+
    |    no     |   yes    |   no     |  (1)   |
    +-----------+----------+----------+--------+
    |    no     |   yes    |   yes    |  (2)   |
    +-----------+----------+----------+--------+
    |    yes    |   no     |   no     |  (3)   |
    +-----------+----------+----------+--------+
    |    yes    |   no     |   yes    |  (3)   |
    +-----------+----------+----------+--------+
    |    yes    |   yes    |   no     |  (4)   |
    +-----------+----------+----------+--------+
    |    yes    |   yes    |   yes    |  (5)   |
    +-----------+----------+----------+--------+

(1) Always accepted if any instance of module X found
(2) Search first for X.yang, which fails;
     Then search for X.*.yang and return any instance
     of module X found (very implementation dependent)
(3) Search fails, requested version not found
(4) If any X.yang found, it is accepted only if its highest
     valued revision date matches the 'importer' value.
(5) If any X.2009-01-01.yang found, it is accepted only
     if its highest valued revision date matches the
     'importer' value.

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Sun, 22 Feb 2009 22:01:14 +0100 (CET)

Hi,

> consensus on the details first.

I agree with your table (it's a bit unclear how row two could be, but
the logic is fine.), and I think it is a very good idea to write about
this in the guidelines draft (and I hope this draft will be a WG item)

/martin

---

From: Andy Bierman <[email-masked]>
Date: Sun, 22 Feb 2009 13:11:45 -0800

> this in the guidelines draft (and I hope this draft will be a WG item)

(sharp as ever)

that is a cut-and-paste bug -- the result should be (2) instead

Andy