Subject: [netmod] if-feature vs. Identifiers and Their Namespaces

From: Robert Varga <[email-masked]>
Date: Fri, 3 Aug 2018 21:10:17 +0200

Hello,

I have went through RFC7950, but I cannot find the text which would give
answer whether:

feature foo;
feature bar;

container baz {
   if-feature "foo and (not baz)";
}

list baz {
   if-feature "(not foo) and baz";
}

is valid YANG or not. The two statements violate Section 6.1.2, but they
are mutually exlusive when conformance comes into play.

Does compliance (Section 5.6) have any bearing on namespaces (Section
6.1.2)?

Thanks,
Robert

---

From: Martin Bjorklund <[email-masked]>
Date: Sun, 05 Aug 2018 13:32:06 +0200 (CEST)

> are mutually exlusive when conformance comes into play.

I think you mean 6.2.1.  You are right; these two statements violate
6.2.1 and this is thus not legal.

Consider what this would mean in the model above:

  augement /baz {
    ...
  }

> Does compliance (Section 5.6) have any bearing on namespaces (Section

Section 5.6 is about server conformance, and the first sentence is:

   Conformance to a model is a measure of how accurately a server
   follows the model.

Namespaces are not related to how accurately a server follows a model.

/martin

---

From: Robert Varga <[email-masked]>
Date: Tue, 7 Aug 2018 16:05:11 +0200

>> are mutually exlusive when conformance comes into play.

Hello Martin,

thanks for your reply.

> Consider what this would mean in the model above:

This is precisely what I considered and in the specific case of list vs.
container, both being mutually exclusive, I have not found a case which
would break down.

> Namespaces are not related to how accurately a server follows a model.

My mistake for not being quite clear. In this context both the list and
container are optional to implement and cannot, obviously, be
implemented at the same time.

That having been said, I much prefer this being invalid YANG to needing
to support it -- just because it keeps my implementation simple :)

Regards,
Robert