Subject: [netmod] multiple if-feature

From: Ladislav Lhotka <[email-masked]>
Date: Fri, 27 Dec 2013 14:38:26 +0100

Hi,

although it may be quite rare, it is possible that a data node has multiple "if-feature" substatements. IMO, it is not clear whether this means:

1. The node is implemented only if all listed features are supported, or

2. it is sufficient if at least one of the features is supported.

RFC 6020 says in Sec. 7.18.2: "The parent statement is implemented by servers that support this feature." This seems to imply option #2. On the other hand, pyang clearly uses #1.

I think both options might potentially make sense, in different circumstances.

Lada

-- 
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C

---

From: Martin Bjorklund <[email-masked]>
Date: Fri, 27 Dec 2013 15:38:17 +0100 (CET)

Ladislav Lhotka <[email-masked]> wrote:
> Hi,
> 
> although it may be quite rare, it is possible that a data node has multiple
> "if-feature" substatements. IMO, it is not clear whether this means:
> 
> RFC 6020 says in Sec. 7.18.2: "The parent statement is implemented by servers
> that support this feature." This seems to imply option #2. On the other hand,
> pyang clearly uses #1.

It is supposed to be #1 - multiple if-features works like AND.  

7.18.1 says

   The "feature" statement is used to define a mechanism by which
   portions of the schema are marked as conditional.  A feature name is
   defined that can later be referenced using the "if-feature" statement
   (see Section 7.18.2).  Schema nodes tagged with a feature are ignored
   by the device unless the device supports the given feature.

The last sentence implies the AND.

It also says:

   Definitions tagged with "if-feature" are ignored when the
   device does not support that feature.

I agree that this should be more clear in 7.18.2

> I think both options might potentially make sense, in different circumstances.

Agreed.  In fact, sometimes you need any boolean expression.
Something to consider for YANG 1.1.

/martin