Re: [netconf] YANG Library 1.1: a deviation module may exist without a module entry?

Jernej Tuljak <jernej.tuljak@mg-soft.si> Fri, 14 May 2021 07:07 UTC

Return-Path: <jernej.tuljak@mg-soft.si>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 847B13A267E for <netconf@ietfa.amsl.com>; Fri, 14 May 2021 00:07:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mg-soft.si
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LiCXsfoNs05w for <netconf@ietfa.amsl.com>; Fri, 14 May 2021 00:07:46 -0700 (PDT)
Received: from galileo.mg-soft.si (gate.mg-soft.si [212.30.73.66]) by ietfa.amsl.com (Postfix) with ESMTP id D1CD73A267D for <netconf@ietf.org>; Fri, 14 May 2021 00:07:45 -0700 (PDT)
Received: from [127.0.0.1] (teleport2.mg-soft.si [10.0.0.254]) by galileo.mg-soft.si (Postfix) with ESMTP id BFA05C41754A; Fri, 14 May 2021 09:07:39 +0200 (CEST)
DKIM-Filter: OpenDKIM Filter v2.11.0 galileo.mg-soft.si BFA05C41754A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mg-soft.si; s=default; t=1620976059; bh=mwMSq/STVZFVOVu29PCdqSoz1B0BObCwpl30jugA1Iw=; h=Subject:To:References:From:Date:In-Reply-To:From; b=Gl6lJT3qZ3jHAdF/8/uwhcP5dIGINcmYWpLwQAH29WObGLjHp9D6bE/n1ttue7lwD aqSWPsw3RR5aDZGMd76OqygK+NxjewaHwvPiiS+pfIsfk48OhL8Ox1WJdIEXgwpzFD wZ0a85MscCAP0U01zWjnt+iX597clsTA+cCEvRumq64MVSXT0KrJUWOL408ymsdjMq sD1yZrUFbgpBReKwUn0TKaOgRklLJqxiy0HVkk0ZcT52Irbz6bV00Drw8QOGPDDCHX vvLjNoFIM9t3ECel+yiTBAOIXbYYK7TuMNRuIgbCD+kuc4fHqMmpBkYMQxV0V23kPP 7vjFEu5sGTvNQ==
To: Ladislav Lhotka <ladislav.lhotka@nic.cz>, netconf@ietf.org
References: <6b520a21-02a7-a41e-caac-fe8dc38a1a9d@mg-soft.si> <f991c985-cc39-3605-34b6-831094ef6e0a@mg-soft.si> <DM6PR08MB50849E201FA7E795438174249B519@DM6PR08MB5084.namprd08.prod.outlook.com> <c93c5998-4223-bccf-1f1f-22ecc2e200ad@nic.cz>
From: Jernej Tuljak <jernej.tuljak@mg-soft.si>
Message-ID: <9b051624-c45e-0929-3b74-4549319301dd@mg-soft.si>
Date: Fri, 14 May 2021 09:07:38 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1
MIME-Version: 1.0
In-Reply-To: <c93c5998-4223-bccf-1f1f-22ecc2e200ad@nic.cz>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/WxoR5ghxIh11cl0OX9PBXZcC0bk>
Subject: Re: [netconf] YANG Library 1.1: a deviation module may exist without a module entry?
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 14 May 2021 07:07:52 -0000

On 13/05/2021 18:04, Ladislav Lhotka wrote:
>
> On 13. 05. 21 17:39, Sterne, Jason (Nokia - CA/Ottawa) wrote:
>> The concept of "deviation module" is a bit odd IMO in RFC8525.
>>
>> Deviation statements can sit in any module and can be mixed in a module that declares other schema nodes (containers, lists, etc).
>>
>> Maybe it is a nice idea for authors to gather deviations into modules that contain nothing but deviation statements, but that would just be a convention of how to organize your modules. Nothing in the specs really requires that.
> Right, I never really understood why the "deviation" leaf-list was
> needed in the first place, given that it is completely redundant. It
> just creates ambiguous situations:
>
> https://mailarchive.ietf.org/arch/msg/netconf/BPVPQf-I9p-1C1K5NLmSsk0K_D8/

Perhaps this was an attempt to ensure the order of applying deviation 
modules to the target module, which may be relevant in some cases (that 
are bad practice and should be avoided anyway).

We encountered a couple of implementations that do the opposite of what 
you (Ladislav) pointed out in that archive thread - they only list 
deviation modules in the "leaf-list"...

Another potential caveat: because of the way the "path" expression for 
this "leafref" is defined ("../../module/name" as opposed to 
"../../../module-set/module/name"), you cannot put a module that 
contains deviations in one module-set as an implementation module and 
reference it in another module-set via this "leaf-list's" value.

   <yang-library xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library">
     <module-set>
       <name>deviations</name>
       <module>
         <name>foo-devs</name>
         <namespace>urn:foo:devs</namespace>
       </module>
     </module-set>
     <module-set>
       <name>common</name>
       <module>
         <name>foo</name>
         <namespace>urn:foo</namespace>
         <deviation>foo-devs</deviation>
       </module>
     </module-set>
     // ...
   </yang-library>

The above instance is not valid according to the model, which I think is 
fine, but may be confusing for some, especially if you consider 
"referential completeness"  of "imports", which only need to become 
complete once woven into a schema list entry, as stated in several 
"description" texts.

Jernej

>
> Lada
>
>> Jason
>>
>>> -----Original Message-----
>>> From: netconf <netconf-bounces@ietf.org> On Behalf Of Jernej Tuljak
>>> Sent: Wednesday, May 12, 2021 7:44 AM
>>> To: Netconf <netconf@ietf.org>
>>> Subject: Re: [netconf] YANG Library 1.1: a deviation module may exist
>>> without a module entry?
>>>
>>> Somehow it slipped my mind that require-instance defaults to true in
>>> YANG 1.1. Everything checks out.
>>>
>>> A server implementation that announces a deviation module in the
>>> "/yang-library/module-set/module/deviation" leaf-list, but lacks a
>>> corresponding entry in "/yang-library/module-set/module" list is
>>> non-RFC8525 compliant.
>>>
>>> Jernej
>>>
>>> On 12/05/2021 11:18, Jernej Tuljak wrote:
>>>> Hi,
>>>>
>>>> is there a particular reason for the deviation leaf-list in
>>>> ietf-yang-library@2019-01-04 not having require-instance true for its
>>>> leafref path, therefore allowing servers to report "incomplete" module
>>>> sets/schemas to the client?
>>>>
>>>>       grouping module-implementation-parameters {
>>>>         description
>>>>           "Parameters for describing the implementation of a module.";
>>>>         leaf-list feature {
>>>>           type yang:yang-identifier;
>>>>           description
>>>>             "List of all YANG feature names from this module that are
>>>>              supported by the server, regardless whether they are defined
>>>>              in the module or any included submodule.";
>>>>         }
>>>>         leaf-list deviation {
>>>>           type leafref {
>>>>             path "../../module/name";
>>>>           }
>>>>
>>>>           description
>>>>             "List of all YANG deviation modules used by this server to
>>>>              modify the conformance of the module associated with this
>>>>              entry.  Note that the same module can be used for deviations
>>>>              for multiple modules, so the same entry MAY appear within
>>>>              multiple 'module' entries.
>>>>
>>>>              This reference MUST NOT (directly or indirectly)
>>>>              refer to the module being deviated.
>>>>
>>>>              Robust clients may want to make sure that they handle a
>>>>              situation where a module deviates itself (directly or
>>>>              indirectly) gracefully.";
>>>>         }
>>>>       }
>>>>
>>>> Why are deviation modules allowed to exist without a module entry
>>>> within YANG Library instances? Why would a server choose to withhold
>>>> namespace information for a deviation module?
>>>>
>>>> Jernej
>>>>
>>>> _______________________________________________
>>>> netconf mailing list
>>>> netconf@ietf.org
>>>> https://www.ietf.org/mailman/listinfo/netconf
>>> _______________________________________________
>>> netconf mailing list
>>> netconf@ietf.org
>>> https://www.ietf.org/mailman/listinfo/netconf
>> _______________________________________________
>> netconf mailing list
>> netconf@ietf.org
>> https://www.ietf.org/mailman/listinfo/netconf
>>