[netmod] Clarify the meaning of property in RFC7950

"Fengchong (frank)" <frank.fengchong@huawei.com> Mon, 08 May 2023 07:15 UTC

Return-Path: <frank.fengchong@huawei.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 3F6F2C14CE51 for <netmod@ietfa.amsl.com>; Mon, 8 May 2023 00:15:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.895
X-Spam-Level:
X-Spam-Status: No, score=-1.895 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=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
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 2FshZunvOLWq for <netmod@ietfa.amsl.com>; Mon, 8 May 2023 00:15:30 -0700 (PDT)
Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3CD7EC14CE3B for <netmod@ietf.org>; Mon, 8 May 2023 00:15:30 -0700 (PDT)
Received: from lhrpeml500003.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4QFCFW40ztz6D8wx for <netmod@ietf.org>; Mon, 8 May 2023 15:13:51 +0800 (CST)
Received: from dggpemm100002.china.huawei.com (7.185.36.179) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 8 May 2023 08:15:26 +0100
Received: from dggpemm500003.china.huawei.com (7.185.36.56) by dggpemm100002.china.huawei.com (7.185.36.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 8 May 2023 15:15:24 +0800
Received: from dggpemm500003.china.huawei.com ([7.185.36.56]) by dggpemm500003.china.huawei.com ([7.185.36.56]) with mapi id 15.01.2507.023; Mon, 8 May 2023 15:15:24 +0800
From: "Fengchong (frank)" <frank.fengchong@huawei.com>
To: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: Clarify the meaning of property in RFC7950
Thread-Index: AdmBefkBKomkmJgWTNm+QEIS0h06QQ==
Date: Mon, 08 May 2023 07:15:24 +0000
Message-ID: <a303de0d14104061975165f3fbdc647b@huawei.com>
Accept-Language: zh-CN, en-US
Content-Language: zh-CN
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.136.113.127]
Content-Type: multipart/alternative; boundary="_000_a303de0d14104061975165f3fbdc647bhuaweicom_"
MIME-Version: 1.0
X-CFilter-Loop: Reflected
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/5sNvaTjijqcxojEIeb8ntLqKp8E>
Subject: [netmod] Clarify the meaning of property in RFC7950
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, 08 May 2023 07:15:34 -0000

Hi all,


In RFC7950 sec 7.20.3.2<https://datatracker.ietf.org/doc/html/rfc7950#section-7.20.3.2>:



   The argument "add" adds properties to the target node.  The

   properties to add are identified by substatements to the "deviate"

   statement.  If a property can only appear once, the property MUST NOT

   exist in the target node.



   The argument "replace" replaces properties of the target node.  The

   properties to replace are identified by substatements to the

   "deviate" statement.  The properties to replace MUST exist in the

   target node.



   The argument "delete" deletes properties from the target node.  The

   properties to delete are identified by substatements to the "delete"

   statement.  The substatement's keyword MUST match a corresponding

   keyword in the target node, and the argument's string MUST be equal

   to the corresponding keyword's argument string in the target node.



What's the meaning of property? Is it a sub-statement?



I see pyang and libyang have two different explanation. Pyang treat 'config' property as always exist property, because 'config' statement has default value (true or derived from parent).

But libyang think if there is no 'config' sub-statement, then the 'config' property will be not exist.



So there is a conflict when using pyang/libyang to parse YANG module.

For example,

Module a {

Container a {



   Leaf b {

     Type string;

   }

}



}





Module a-dev {

   Deviation  "/a:a/a:b" {

     Deviate add {

       Config false;

    }

   }

}



This example, pyang will report error, because pyang think 'config' property is always exist, so this propery should not be added. But libyang think it's valid.



If we change the type of deviate from 'add' to 'replace'.



Module a-dev {

   Deviation  "/a:a/a:b" {

     Deviate replace {

       Config false;

    }

   }

}



Pyang will think it's valid. But libyang think it's invalid.



So I think WG should clarify what's the meaning of property.



Ref:

Issue on pyang: https://github.com/mbj4668/pyang/issues/815



Issue on libyang: https://github.com/CESNET/libyang/issues/2010