Subject: [netmod] external deviations files

From: Andy Bierman <[email-masked]>
Date: Sat, 01 Aug 2009 18:35:05 -0700

Hi,

Sec. 5.6.4 clearly says that the deviation
parameter indicates the name of the module
defining device deviations.

So even though deviation-stmt is defined
in body-stmt, the deviation(s) advertised
in a module capability cannot be sub-modules.

If the deviations are located in a submodule,
then the main module is advertised instead.

You cannot go backwards from a sub-module to
the exact main module because the belongs-to statement
does not have a revision-date field.

How come deviations are stored in YANG modules,
but their revision dates are ignored, unlike
a real YANG module.  An agent has no way to advertise
to revision of the deviations module used.

Deviations which are external (the target is
in a different module) are too complicated to fully
process when the deviations file contains local
typedefs and identities.  It is also unnatural because
the deviations module needs to import the target
module, but (of course) the target module cannot import the
deviations module, or an imports loop would form.

So with deviations, the patched file can end up
referencing definitions which are not imported
at all.  This will result in errors.

I think the draft needs to be clear that the
patched object (deviations applied) MUST be
valid using just the imports and includes in
the patched file.

e.g.:

 module-capability&module=foo&revision=2009-08-01&deviation=dev

module dev {
   namespace "dev-NS";
   prefix dev;

   import foo {
     prefix foo;
     revision-date 2009-08-01;
   }

   typedef mytype {
      type string;
   }

   deviation /foo:bar/foo:baz {
      deviate replace {
        type {
           dev:mytype;
        }
      }
   }
}

This will cause an error in the patched foo module,
because dev:mytype cannot be found.

Andy