Re: [netmod] Hi all, one issue about YANG deviate's Substatements

Alex Campbell <Alex.Campbell@Aviatnet.com> Tue, 21 February 2017 21:00 UTC

Return-Path: <Alex.Campbell@Aviatnet.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 383321297CB for <netmod@ietfa.amsl.com>; Tue, 21 Feb 2017 13:00:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 kkPCfMTxPBHf for <netmod@ietfa.amsl.com>; Tue, 21 Feb 2017 13:00:15 -0800 (PST)
Received: from mail-send.aviatnet.com (mail-send.aviatnet.com [192.147.115.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7D10E1294B5 for <netmod@ietf.org>; Tue, 21 Feb 2017 13:00:15 -0800 (PST)
From: Alex Campbell <Alex.Campbell@Aviatnet.com>
To: Andy Bierman <andy@yumaworks.com>, "Zhengguangying (Walker)" <zhengguangying@huawei.com>
Thread-Topic: [netmod] Hi all, one issue about YANG deviate's Substatements
Thread-Index: AdKMHQ/ctY80IV+HTn2lT6clGq6QXAAngtSA//+UWUU=
Date: Tue, 21 Feb 2017 21:00:14 +0000
Message-ID: <1487710813907.73302@Aviatnet.com>
References: <381D7D55085B1E4D8B581BD652E1E140B2A1B7A3@nkgeml513-mbs.china.huawei.com>, <CABCOCHTthMC0VzU9X8gboZVSr+J7+=QyUJ2DVPKBfWO52ciH6w@mail.gmail.com>
In-Reply-To: <CABCOCHTthMC0VzU9X8gboZVSr+J7+=QyUJ2DVPKBfWO52ciH6w@mail.gmail.com>
Accept-Language: en-NZ, en-US
Content-Language: en-NZ
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.15.6.10]
Content-Type: multipart/alternative; boundary="_000_148771081390773302Aviatnetcom_"
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/1ReycNBO4Ismxk_p4p4YUebp6W0>
Cc: "netmod@ietf.org" <netmod@ietf.org>, "Qudan (Beijing-NOS)" <qudan.qudan@huawei.com>, Yangang <yangang@huawei.com>
Subject: Re: [netmod] Hi all, one issue about YANG deviate's Substatements
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, 21 Feb 2017 21:00:17 -0000

Hi,


I believe you misunderstood the intention.

A "when" statement inside a deviation would simply add/remove/update a "when" statement in the target module. It would not make the deviation conditional.


I asked this some time ago, and for some reason I was told that it would be overly complex to implement, and to use a "must" statement instead. But I disagree with this resolution.


Alex


________________________________
From: netmod <netmod-bounces@ietf.org> on behalf of Andy Bierman <andy@yumaworks.com>
Sent: Wednesday, 22 February 2017 8:23 a.m.
To: Zhengguangying (Walker)
Cc: Qudan (Beijing-NOS); netmod@ietf.org; Yangang
Subject: Re: [netmod] Hi all, one issue about YANG deviate's Substatements



On Tue, Feb 21, 2017 at 12:32 AM, Zhengguangying (Walker) <zhengguangying@huawei.com<mailto:zhengguangying@huawei.com>> wrote:
Hi all,

  When we define YANG models, there has one issue about "deviate's Substatements"

  In section 7.20.3.2.  The "deviate" Statement given the Substatements supported, but "when" not there.
config       | 7.21.1       | 0..1        |
               | default      | 7.6.4, 7.7.4 | 0..n        |
               | mandatory    | 7.6.5        | 0..1        |
               | max-elements | 7.7.6        | 0..1        |
               | min-elements | 7.7.5        | 0..1        |
               | must         | 7.5.3        | 0..n        |
               | type         | 7.4          | 0..1        |
               | unique       | 7.8.3        | 0..n        |
               | units        | 7.3.3        | 0..1        |
               +--------------+--------------+-------------+
Now, we have the scenario to add "when" constrains when deviate the existed YANG module, how I can do it?


You cannot add when-stmts to deviations.
It is not supported.  Deviations cannot be conditional.

May be it need extend the Substatements of "devite" to add "when", what's yours opinion, please help to share, thanks.

Thanks & regards

Walker (Guangying zheng)




Andy


_______________________________________________
netmod mailing list
netmod@ietf.org<mailto:netmod@ietf.org>
https://www.ietf.org/mailman/listinfo/netmod