Re: [netmod] YANG augmentation in notification

Martin Björklund <mbj+ietf@4668.se> Mon, 05 December 2022 10:02 UTC

Return-Path: <mbj+ietf@4668.se>
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 74F9CC14CE3E for <netmod@ietfa.amsl.com>; Mon, 5 Dec 2022 02:02:29 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.096
X-Spam-Level:
X-Spam-Status: No, score=-5.096 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, PDS_NAKED_TO_NUMERO=1.999, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=4668.se header.b=Qt+hSZ6c; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=ECNwr9Ql
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LBaQWBYCuy1t for <netmod@ietfa.amsl.com>; Mon, 5 Dec 2022 02:02:24 -0800 (PST)
Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7930DC14F720 for <netmod@ietf.org>; Mon, 5 Dec 2022 02:02:23 -0800 (PST)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5DB835C00BD; Mon, 5 Dec 2022 05:02:21 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 05 Dec 2022 05:02:21 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=4668.se; h=cc:cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1670234541; x= 1670320941; bh=W/8d4e2AQK6A7xvuQJwujAlJjs96pYwB3kDYbUa1z38=; b=Q t+hSZ6c8m/G//nHkgDthQh+W4Goxtn0emkl7J6e/eZRUiAsFpkO14vwi+9KRB6P1 XfQhJXUCa0IC3llakziGsvfOK/99Cj6MRP5iZAakWWnzoJyNurMf5mzLYPOHNdVf yKd9BeEcp6Vgv+zogbj0cPGlvLmt6iUYAi02ldAWENtzUBY+GU14suABpKIosaOE pPOWz+ECDSjce5/FwWc7JImeDheladG2rnNcSHO+gJTD0mrkYPmH4KFw13KdiFwV ts7iwkm6xEaEZWVazUiDXAbhbVjsJrHtMLi87SH8FbDkwS6DRjM1YWYIm8z+1qsP IWv23WIf/sg1h0JclPLUQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1670234541; x= 1670320941; bh=W/8d4e2AQK6A7xvuQJwujAlJjs96pYwB3kDYbUa1z38=; b=E CNwr9Ql7jZ/0CTjxiPNPonfdLKxzfXCb/yt6+o1sdphqIdb4bP2NX0kxhabJbBT4 bawxA4DteXvH27MjEsNQRxSVglv2Ky/2kNALIfD9ZW/7bvf5WrL6JQVCqpl1pmfF d1imja3qf1vVpHX/BhyLZr+Il9YsNa9mRoJoYEez8Z1AFemPzqyLKuBB+5uk+0Tu ddbvnMXdWDD3S8PAfG7QQNwAwAkN98ykVmXNDRFUswYTStN3s+y+JS+1/Eyqq46B UNNUreh+nw82lcrfZT5tjh2hROqj829EPEtehf9xwT6TWXlwcCQ0hX5aqi4B5pam SlsHlstCAtGBBOyS0WUdA==
X-ME-Sender: <xms:rcGNYwuyfJqMcf0GEeOLkI-bSJ_L4tEOp-O7Fw7NmXeecJI1Yv7dNQ> <xme:rcGNY9fMJ8Mn1zUms2wNYhYe3VuCMwIBqXP9iaTkbwqVqHjtWHqBQV8YBnUzz1G9g 30ujUQXeSSUQgqcIRs>
X-ME-Received: <xmr:rcGNY7y5jxlIfHai1UF7n8elaEWiEaKctIPDRjx-AyTow0Kr0XkMk4Q6U5W71yNgL_rIrACjDNEOjRH8RoTjoP8spw1YTTameg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeggdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffkvfevuffhjghfofggtgfgsehtsg ertdertdejnecuhfhrohhmpeforghrthhinhcuuehjnphrkhhluhhnugcuoehmsghjodhi vghtfhesgeeiieekrdhsvgeqnecuggftrfgrthhtvghrnhepudffuedtudegjeejhfduhe ffveeuvedtkeejfedvvdekteeludehffegteehfeefnecuffhomhgrihhnpehivghtfhdr ohhrghdprhhftgdqvgguihhtohhrrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgsjhdoihgvthhfseegieeikedrshgv
X-ME-Proxy: <xmx:rcGNYzNpRIlYD7btY1mHKzFvsAOAcGTSKpgrcrYaajsjT8YKQ0k08A> <xmx:rcGNYw9h7FlR4NX-0KuxViy4VW5-t9ck_ZJZztdFRii0fOXPPrIWIg> <xmx:rcGNY7Vpk6URK4Q9iVykySlaXX6aQDjnXbCXv6P-RiqWRxnuFa7g8Q> <xmx:rcGNY-lH3iscef8rHyxuoycT97YwRvjb0gDxic0RK5cN5uimtj9YWA>
Feedback-ID: icc614784:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 5 Dec 2022 05:02:20 -0500 (EST)
Date: Mon, 05 Dec 2022 11:02:18 +0100
Message-Id: <20221205.110218.1169164776212238415.id@4668.se>
To: alex.huang-feng@insa-lyon.fr
Cc: netmod@ietf.org, Thomas.Graf@swisscom.com
From: Martin Björklund <mbj+ietf@4668.se>
In-Reply-To: <BE9858A6-80CF-4819-89C6-4FE8EBA603B7@insa-lyon.fr>
References: <BE9858A6-80CF-4819-89C6-4FE8EBA603B7@insa-lyon.fr>
X-Mailer: Mew version 6.8 on Emacs 26.3
Mime-Version: 1.0
Content-Type: Text/Plain; charset="utf-8"
Content-Transfer-Encoding: base64
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/kH-zwf7rA5pLcMA3mLLsobM1ZfU>
Subject: Re: [netmod] YANG augmentation in notification
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
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: Mon, 05 Dec 2022 10:02:29 -0000

Hi,

Alex Huang Feng <alex.huang-feng@insa-lyon.fr> wrote:
> Dear NETMOD WG,
> 
> Some time ago I sent this email to the YANG doctors to check with
> them. I would also like to have your insights on mandatory augmented
> leaves.
> 
> We are working on a YANG module for the following draft:
> https://datatracker.ietf.org/doc/draft-tgraf-netconf-yang-notifications-versioning/
> <https://datatracker.ietf.org/doc/draft-tgraf-netconf-yang-notifications-versioning/>
> In this draft, we are augmenting a notification container in the YANG
> module adding new leaves.
> We would like to have some of these leaves mandatories if the current
> YANG is used but are having an error code using the pyang compiler
> (error: cannot augment with mandatory node "revision-label”).
> 
> The resulting YANG tree without the mandatory statement is the
> following:
> module: ietf-yang-push-metadata
> 
>   augment /yp:push-update:
>     +--ro module?                     string
>     +--ro namespace?                  string
>     +--ro revision?                   rev:revision-date-or-label
>     +--ro revision-label?             ysver:version
>     +--ro datastore-xpath-filter?     yang:xpath1.0 {sn:xpath}?
>     +--ro datastore-subtree-filter?    {sn:subtree}?
> In RFC7950 Section 7.17, there is the following statement regarding
> the mandatory fields in augmented YANGs:
> 
> If the augmentation adds mandatory nodes (see Section 3
> <https://www.rfc-editor.org/rfc/rfc7950#section-3>) that
>    represent configuration to a target node in another module, the
     ^^^^^^^^^^^^^^^^^^^^^^^

>    augmentation MUST be made conditional with a "when" statement.  Care
>    must be taken when defining the "when" expression so that clients
>    that do not know about the augmenting module do not break.
> 
> Does this statement applies to YANG notification containers?
> Or does this statement applies only to configuration YANG modules?

It applies to configuration nodes.

> Is this a pyang compiler bug?

Yes.


/martin



> 
> Regards,
> 
> Alex Huang Feng