[yang-doctors] conditional default?

Christian Hopps <chopps@chopps.org> Sun, 23 May 2021 04:20 UTC

Return-Path: <chopps@chopps.org>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B5BE43A2C4C for <yang-doctors@ietfa.amsl.com>; Sat, 22 May 2021 21:20:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=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 Mrs-NgQ_c0Ho for <yang-doctors@ietfa.amsl.com>; Sat, 22 May 2021 21:20:43 -0700 (PDT)
Received: from smtp.chopps.org (smtp.chopps.org [54.88.81.56]) by ietfa.amsl.com (Postfix) with ESMTP id 131233A2C4B for <yang-doctors@ietf.org>; Sat, 22 May 2021 21:20:42 -0700 (PDT)
Received: from ja.int.chopps.org.chopps.org (047-026-251-217.res.spectrum.com [47.26.251.217]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by smtp.chopps.org (Postfix) with ESMTPSA id ED2DC80E04; Sun, 23 May 2021 04:20:41 +0000 (UTC)
User-agent: mu4e 1.5.13; emacs 27.2
From: Christian Hopps <chopps@chopps.org>
To: yang-doctors@ietf.org
Cc: chopps@chopps.org
Date: Sun, 23 May 2021 00:14:08 -0400
Message-ID: <m2mtsm9j3a.fsf@ja.int.chopps.org>
MIME-Version: 1.0
Content-Type: text/plain; format="flowed"
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/1ZOUzbh4EX1JWKxjEVEBUmfXOQM>
Subject: [yang-doctors] conditional default?
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 23 May 2021 04:20:45 -0000

I received this good question during the IESG review of geo location module:

> * Is WGS-84 still the default for geodetic-datum when astronomical-body != "earth"?
> ...
> I don't know enough YANG to know if the "when" statement is usable in this case to constrain the applicability of this default or not.

Is there a way to specify a conditional default in YANG?

A separate but related issue I ran into the other day is that I have a Boolean in a grouping that can default to true or false (in the actual software) depending on where it is included... Also curious if that's solvable.

Thanks,
Chris.