Subject: [netmod] leafref corner case

From: Andy Bierman <[email-masked]>
Date: Wed, 12 Aug 2009 08:51:10 -0700

Hi,

I'm sure glad we think it is so important to
have leafrefs in the database, because they
are really a pain to implement as database objects.

Here are 2 more corner-cases:

   list top {
      key a;
      leaf a { type int8; }
      leaf foo { type string; }
   }

   container copy {
      presence "Cannot use a top-level mandatory container";

      leaf fooref {
         type leafref { path /top/foo; }
         mandatory true;
      }
   }

   ...

   deviation /top/foo {
      deviate not-supported;
   }

1) mandatory pointing at optional
   this is legal YANG, but it doesn't really work

2) defunct leafref due to deviations
   Deviations are patches.
   In this agent, there is no leaf /top/foo.
   So what happens to leaf /copy/fooref?

Andy