Subject: [netmod] Deviating away /interfaces-state

From: Balazs Lengyel <[email-masked]>
Date: Mon, 10 Sep 2018 11:48:52 +0200

Hello,

We would like to remove the if:interfaces-state with a deviation
as it will never contain any information. So we wanted to use

deviation /if:interfaces-state {
deviate not-supported;
}

However after this we get an error as ietf-interfaces has a definition:

/*
* Legacy typedefs
*/

typedef interface-state-ref {
type leafref {
path "/if:interfaces-state/if:interface/if:name";
}
status deprecated;
description
"This type is used by data models that need to reference
the operationally present interfaces.";
}

Here the path statement will point at a non-existent branch.

So is there a correct way to indicate we do not support /interface-state ?
regards Balazs

--
Balazs Lengyel Ericsson Hungary Ltd.
Senior Specialist
Mobile: +36-70-330-7909 email: [email-masked]

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 10 Sep 2018 13:27:15 +0200

On Mon, 2018-09-10 at 11:48 +0200, Balazs Lengyel wrote:
> Hello,
> We would like to remove the if:interfaces-state with a deviation as it will
> never contain any information. So we wanted to use 

I think this check really goes overboard. Sec. 9.9.2 in RFC 7950 says:

   The "path" expression evaluates to a node set consisting of zero,
   one, or more nodes.  If the "require-instance" property is "true",
   this node set MUST be non-empty.

However, evaluating an XPath expression make sense only in the context of a
concrete instance data tree. Therefore, no error should be reported unless an
instance of a leaf with the "instance-state-ref" type exists. With the typedef
below, we are two steps away from that.

Lada  

> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 10 Sep 2018 13:57:57 +0200 (CEST)

Hi,

> > deviation /if:interfaces-state {

Yes, this is the proper way to do it.

> I think this check really goes overboard.
>
> Sec. 9.9.2 in RFC 7950 says:
> 

It also says about the "path" statement:

   It takes as an
   argument a string that MUST refer to a leaf or leaf-list node.

The intention was that it is an error if the path doesn't refer to a
leaf[-list] schema node, but depending on "require-instance" the leaf
instance might not have to exist.

However, I do agree that it in this particular case, as long as the
type isn't used in the system, it should not be reported as an error.

/martin