Subject: [Netconf] deviation that changes config true to false: deviate add or replace?

From: "Larsson, Gustav" <[email-masked]>
Date: Wed, 16 Mar 2016 18:45:40 -0400

Hello,

When a node defaults to config true and a deviation changes it to config false, should "deviate add" or "deviate replace" be used? Some YANG implementations allow either, some allow only "deviate replace". Perhaps some allow only "deviate add" but we have not yet seen that.

Consider these definitions:

  container x {
    leaf y {
      type string;
    }
  }

  deviation /x/y {
    deviate replace {     <--  Should this be add or replace?
      config false;
    }
  }

Section 7.18.3.2 of RFC 6020 says:

   The argument "add" adds properties to the target node.  The
   properties to add are identified by substatements to the "deviate"
   statement.  If a property can only appear once, the property MUST NOT
   exist in the target node.

   The argument "replace" replaces properties of the target node.  The
   properties to replace are identified by substatements to the
   "deviate" statement.  The properties to replace MUST exist in the
   target node.

/x/y is config true by default even though config is not explictly given. Section 7.19.1 of RFC 6020 is not clear about whether config is considered to exist when defaulted.

If config is considered to exist, then "deviate replace" is correct. Otherwise, "deviate add" is correct. Technically, RFC 6020 allows only one or the other but not both in this case, but perhaps a robust implementation should accept both.

YANG file authors need to pick one or the other, so clear guidance would be helpful.

Thanks,
Gustav

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 17 Mar 2016 08:14:19 +0100 (CET)

Hi,

Could you resend this email to [email-masked] - that's where
YANG-specific issues are discussed.

/martin