Re: [netmod] [Netconf] What should a server response be? - depending on NP-containers

Ladislav Lhotka <lhotka@nic.cz> Tue, 23 August 2016 10:46 UTC

Return-Path: <lhotka@nic.cz>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A2C0E12B04B for <netmod@ietfa.amsl.com>; Tue, 23 Aug 2016 03:46:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.548
X-Spam-Level:
X-Spam-Status: No, score=-7.548 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.548] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 H-0jC9ckwpHd for <netmod@ietfa.amsl.com>; Tue, 23 Aug 2016 03:45:59 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2F6CB12B044 for <netmod@ietf.org>; Tue, 23 Aug 2016 03:45:59 -0700 (PDT)
Received: from [IPv6:2001:718:1a02:1:998e:ff6a:8065:9f67] (unknown [IPv6:2001:718:1a02:1:998e:ff6a:8065:9f67]) by mail.nic.cz (Postfix) with ESMTPSA id DDD5D60DD7; Tue, 23 Aug 2016 12:45:57 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1471949157; bh=rV3QOtc8JzVbKl9mr4mupZEFJuuKZNi+784l6ZAZ8rs=; h=From:Date:To; b=vnPJ2qaprmgM6/cMtiBGyWSIvnUzQ3KVcb//yJgtddyI1Vul6rDfjyuVg09S5u+UF HxK9TGoITSDtIBybDg23AqRjI6D4jOatte+QVMnuXLBXaIe01GRGDLV+Bd/63OFwoY 4KrF6NLhxOREBMzQjdqKgAOl7ZDe68QJm++T7cjE=
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Ladislav Lhotka <lhotka@nic.cz>
In-Reply-To: <20160823.110924.2249827059453254780.mbj@tail-f.com>
Date: Tue, 23 Aug 2016 12:45:58 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <C5A2A165-CA74-4548-AED4-72A0162A779F@nic.cz>
References: <57BC04E4.6090308@transpacket.com> <20160823.101517.293640528041965584.mbj@tail-f.com> <57BC0A70.1080006@transpacket.com> <20160823.110924.2249827059453254780.mbj@tail-f.com>
To: Martin Björklund <mbj@tail-f.com>
X-Mailer: Apple Mail (2.3124)
X-Virus-Scanned: clamav-milter 0.98.7 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/bzxjzFBxNfzVXN0LDlnoKygACqg>
Cc: netmod@ietf.org
Subject: Re: [netmod] [Netconf] What should a server response be? - depending on NP-containers
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 23 Aug 2016 10:46:00 -0000

> On 23 Aug 2016, at 11:09, Martin Bjorklund <mbj@tail-f.com> wrote:
> 
> Vladimir Vassilev <vladimir@transpacket.com> wrote:
>> On 08/23/2016 10:15 AM, Martin Bjorklund wrote:
>>> They are evaluated.  See Section 7.5.3:
>>> 
>>>    When a datastore is validated, all "must" constraints are
>>>    conceptually evaluated once for each node in the accessible tree (see
>>>    Section 6.4.1).
>>> 
>>> 
>>> /martin
>> Then we have the case I objected to and the example:
>> 
>> YANG 1.0:
>> 
>> augment "/if:interfaces/if:interface" {
>>    container inet {
>>        must "../name = 'me0'" {
> 
> This should have been a 'when' expression, not 'must'.  Alternatively,

An interesting case would be if there is the "when" statement as you suggest, and then also one or more "must" statements. IMO, in this case the "when" statement needs to be evaluated first using the procedure of sec. 7.21.5, and if (and only if) the result is true, then the "must" statements are evaluated. Again, an NP-container is no different from a leaf with a default value.

Lada

> it should have been a P-container, since obviously the container has
> some semantics.  Or alternatively, the must expression should have
> been on the address leaf, since this is what you really checked.
> 
> 
> 
> /martin
> 
> 
>>            description
>>                 "The inet container is only valid for the management ('me0')
>>                 interface.";
>>        }
>>        leaf address {
>>            type inet:ip-prefix;
>>        }
>>    }
>> }
>> 
>> YANG 1.1 (replace "../name = 'me0'" with "../name='me0' or not
>> (./address)" and process 95 unnecessary Xpath evaluations).
>> 
>> I think this proves the argument that there will be more unnecessary
>> Xpath processing.  In addition it illustrates how a simple task
>> requires ugly patch (the ".. or not (./address)" added to the must
>> expression) just to ensure the expression does not fail in the default
>> case where the interface is not named "me0" and the user has not even
>> attempted to create empty /interfaces/interface/inet container in YANG
>> 1.1.
>> 
>> Vladimir
>> 
> 
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

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