Re: [netmod] ?= ?==?utf-8?q? mandatory choice with non-presence container cas

Ladislav Lhotka <lhotka@nic.cz> Tue, 25 June 2019 11:31 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 CABE612013D for <netmod@ietfa.amsl.com>; Tue, 25 Jun 2019 04:31:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.996
X-Spam-Level:
X-Spam-Status: No, score=-6.996 tagged_above=-999 required=5 tests=[BAD_ENC_HEADER=0.001, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] 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 jlAZVmxeP0iY for <netmod@ietfa.amsl.com>; Tue, 25 Jun 2019 04:31:54 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 75A3C12004D for <netmod@ietf.org>; Tue, 25 Jun 2019 04:31:54 -0700 (PDT)
Received: from birdie (unknown [IPv6:2001:1488:fffe:6:a88f:7eff:fed2:45f8]) by mail.nic.cz (Postfix) with ESMTPSA id 1E794140829 for <netmod@ietf.org>; Tue, 25 Jun 2019 13:31:52 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1561462312; bh=hASqUcYdeDU2NBwVJQ1mUmUSij1gGWd0mB15TkLpAl0=; h=From:To:Date; b=XwkKBB/2Df6IskQ6ucUxKE6B59dckrAhwFcrf0/9CC5xJ06sGcicfEA3sligkCr8f VxFLGEjDiWcC83bdCCrlTFBGmzkZUVByolpvJ7ES7FMG7Bx4mWQ0s9ysGlyep06Q8C Fjrm1ZZX0YsdwcQDYL+FZBsxiXCJ+zrjOPZHr7S0=
Message-ID: <d04461bc1fb8c17e56bb1b27f74c1daf65e46b46.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: NETMOD WG <netmod@ietf.org>
Date: Tue, 25 Jun 2019 13:31:51 +0200
In-Reply-To: <20190625.095812.959182004133340318.mbj@tail-f.com>
References: <ad3-5d110500-55-63a2bc80@40796557> <0100016b8c38574d-9d8aad57-3e50-45c4-98bb-24091a765ded-000000@email.amazonses.com> <87tvceunai.fsf@nic.cz> <20190625.095812.959182004133340318.mbj@tail-f.com>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.32.3
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.100.3 at mail.nic.cz
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/VixFDSLNfH-4dkR4cKQ8Tqs7QOY>
Subject: Re: [netmod] ?= ?==?utf-8?q? mandatory choice with non-presence container cas
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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, 25 Jun 2019 11:31:57 -0000

On Tue, 2019-06-25 at 09:58 +0200, Martin Bjorklund wrote:
> Ladislav Lhotka <lhotka@nic.cz> wrote:
> > Kent Watsen <kent@watsen.net> writes:
> > 
> > > Hi Michal,  
> > > > I agree, but these valid data were correctly printed into invalid
> > > > data. I do not think printing is allowed to change the validity of
> > > > data.
> > >  The NP-container text is unclear.
> > 
> > This issue IMO has more to do with the "mandatory" statement under
> > "choice". Similar problems can be caused by data nodes that depend on
> > "when". For example:
> > 
> > choice sel {
> >    madatory true;
> >    leaf foo {
> >        when "...";
> >        ...
> >    }
> >    leaf bar { ... }
> >    leaf baz { ... }
> > 
> > If "foo" exists in instance data but its when condition becomes false,
> > the server is expected to remove the "foo" instance, but what next?
> > The data becomes invalid, but the server can hardly include "bar" or
> > "baz" on its own.
> 
> Right, so that change (that would make the when condition false) will
> be rejected by the server, since the resulting config would be
> invalid.

Yes, this is actually the only sane behaviour that should be applied each time a
when constraint becomes invalid - rather then auto-delete the conditional nodes.

Regarding NP-containers, I think their character implies that they can never be
empty in the schema. This should probably be stated in the YANG spec.

Lada

> 
> 
> /martin
> 
> 
> 
> 
> > Lada
> > 
> > > I'm unsure if you saw the thread in NETCONF, but I filed this issue
> > > over the weekend.  Please add to it, if only to include a link to this
> > > thread: https://github.com/netmod-wg/yang-next/issues/88. Thanks, Kent
> > > _______________________________________________ netmod mailing list
> > > netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod
> > 
> > -- 
> > Ladislav Lhotka Head, CZ.NIC Labs PGP Key ID: 0xB8F92B08A9F76C67
> > 
> > _______________________________________________
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod
> > 
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67