Subject: [Netconf] problem with validate:1.1

From: Andy Bierman <[email-masked]>
Date: Tue, 18 May 2010 15:29:52 -0700

Hi,

I am working on the next version of the 4741bis draft.

  feature validate {
    status "deprecated";
    ...
  }
 
  feature validate-1.1 {
    ...
  }
 
  leaf test-option {
    if-feature validate;
    type enumeration {
    enum test-then-set;
    enum set;
    enum test-only {
      description
        "This value can only be used if the 'validate-1.1'
         feature is supported.";
      }
    }
  }

Notice what is broken?
We can never deprecate the validate:1.0 capability
feature because of the 'if-feature' stmt in the 'test-option'
leaf.

We can only AND if-feature-stmts together, not OR them
together like is needed in this case:

  leaf test-option {
    if-feature "validate or validate-1.1";
    type enumeration {
     ...
    }
  }

Another solution (I've already implemented) is to use an XPath function:

   boolean feature-enabled (string module-name, string feature-name);

   Returns 'true' if the feature 'feature-name' from module 'module-name'
   is enabled.  Returns 'false' otherwise.

  leaf test-option {
    when "feature-enabled('ietf-netconf', 'validate') or
          feature-enabled('ietf-netconf', 'validate-1.1')";
    type enumeration {
     ...
    }
  }

Another solution is to remove the 'status deprecated' from the
validate feature, and add an if-feature validate; statement
to the validate-1.1 feature.  Essentially, we can never
deprecate old features, just keep adding to them.

So which solution should we use?

  1) change YANG if-feature-stmt
  2) add feature-enabled XPath function for when-stmt
  3) never deprecate the old feature version;
     the new version adds to the old instead of replacing it.

Only (3) is easy in the short-term,
but also the most painful in the long-term.

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Fri, 21 May 2010 13:30:14 +0200 (CEST)

> feature because of the 'if-feature' stmt in the 'test-option'

Since we now have decided to define a base:1.1 capability, we should
not even define the deprecated "validate" feature.  This document
should just define the validate:1.1 capabiltiy, and specifiy what it
can do.

/martin