Re: [netmod] Interaction of 'when' and 'default' statements

Martin Bjorklund <mbj@tail-f.com> Wed, 22 March 2017 18:23 UTC

Return-Path: <mbj@tail-f.com>
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 1A993129BCC for <netmod@ietfa.amsl.com>; Wed, 22 Mar 2017 11:23:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Level:
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 bw1tSXmsgXpH for <netmod@ietfa.amsl.com>; Wed, 22 Mar 2017 11:23:03 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 45E30129BCF for <netmod@ietf.org>; Wed, 22 Mar 2017 11:23:03 -0700 (PDT)
Received: from localhost (h-148-188.a165.priv.bahnhof.se [176.10.148.188]) by mail.tail-f.com (Postfix) with ESMTPSA id 6F53F1AE05F8; Wed, 22 Mar 2017 19:23:00 +0100 (CET)
Date: Wed, 22 Mar 2017 19:23:00 +0100
Message-Id: <20170322.192300.1698563417511122835.mbj@tail-f.com>
To: wivory@Brocade.com
Cc: netmod@ietf.org, brownn@Brocade.com
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <fbb634da88914796aaa21ce5c5cb924e@EMEAWP-EXMB12.corp.brocade.com>
References: <ae8d8d4e64e34dc8bb21fac7d90eb2c0@EMEAWP-EXMB12.corp.brocade.com> <20170322.185242.1479962682961917887.mbj@tail-f.com> <fbb634da88914796aaa21ce5c5cb924e@EMEAWP-EXMB12.corp.brocade.com>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/3pC6XcTfbUkbwV9DQSAeF2MmsNo>
Subject: Re: [netmod] Interaction of 'when' and 'default' statements
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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: Wed, 22 Mar 2017 18:23:05 -0000

William Ivory <wivory@Brocade.com> wrote:
> Hi Martin,
> 
> Thanks.  Can you point me at the part of RFC 6020 that explicitly
> states that 'when' wins over 'default'?

Section 7.6.1 of RFC 7950 says:

   Note that if the leaf or any of its ancestors has a "when" condition
   or "if-feature" expression that evaluates to "false", then the
   default value is not in use.


/martin


> 
> William
> 
> -----Original Message-----
> From: Martin Bjorklund [mailto:mbj@tail-f.com] 
> Sent: 22 March 2017 17:53
> To: William Ivory <wivory@Brocade.com>
> Cc: netmod@ietf.org; Nick Brown <brownn@Brocade.com>
> Subject: Re: [netmod] Interaction of 'when' and 'default' statements
> 
> William Ivory <wivory@Brocade.com> wrote:
> > Hi,
> > 
> > I'm looking for clarification of the 'when' and 'default' statements 
> > on a leaf.  For example, if a leaf has a 'default', can it also have a 
> > 'when' statement that could cause it to disappear if the 'when'
> > condition evaluates to false?
> 
> Yes, and in that case the default doesn't apply.
> 
> > Section 8.3 or RFC 6020 isn't clear on how evaluation of constraints 
> > should be done here, and neither the section on the 'when' statement 
> > nor the 'default' section have any cross-references.
> 
> If the "when" expression evaluates to false, it's like if the whole node doesn't exist.  A client can't set it etc.
> 
> 
> /martin
>