[netmod] a question about 'when'

"Fengchong (frank)" <frank.fengchong@huawei.com> Mon, 05 August 2019 03:32 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 A4DCD120146 for <netmod@ietfa.amsl.com>; Sun, 4 Aug 2019 20:32:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Level:
X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, 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 aSMe7sjI71kN for <netmod@ietfa.amsl.com>; Sun, 4 Aug 2019 20:32:19 -0700 (PDT)
Received: from huawei.com (lhrrgout.huawei.com [185.176.76.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 00355120140 for <netmod@ietf.org>; Sun, 4 Aug 2019 20:32:18 -0700 (PDT)
Received: from lhreml706-cah.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id 58F3F18BD8B4E4B6A98C for <netmod@ietf.org>; Mon, 5 Aug 2019 04:32:16 +0100 (IST)
Received: from DGGEMM422-HUB.china.huawei.com (10.1.198.39) by lhreml706-cah.china.huawei.com (10.201.108.47) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 5 Aug 2019 04:32:15 +0100
Received: from DGGEMM533-MBS.china.huawei.com ([169.254.6.160]) by dggemm422-hub.china.huawei.com ([10.1.198.39]) with mapi id 14.03.0439.000; Mon, 5 Aug 2019 11:32:07 +0800
From: "Fengchong (frank)" <frank.fengchong@huawei.com>
To: "netmod@ietf.org" <netmod@ietf.org>
CC: "Zhangxiaoping (C)" <zhang.xiaoping@huawei.com>, liuzhiying <liuzhiying@huawei.com>
Thread-Topic: a question about 'when'
Thread-Index: AdVLPM5Xmpgaa94hSz6Z+hOvCeCLfw==
Date: Mon, 05 Aug 2019 03:32:07 +0000
Message-ID: <5756FB984666AD4BB8E1D63E2E3AA3D001EE95B1@DGGEMM533-MBS.china.huawei.com>
Accept-Language: en-US
Content-Language: zh-CN
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.134.40.226]
Content-Type: multipart/alternative; boundary="_000_5756FB984666AD4BB8E1D63E2E3AA3D001EE95B1DGGEMM533MBSchi_"
MIME-Version: 1.0
X-CFilter-Loop: Reflected
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/sli6SqRdpQvuIj3QYvU_Vt5Zo50>
Subject: [netmod] a question about 'when'
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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 Aug 2019 03:32:20 -0000

Hi all,

I encounter a question about 'when', when I implement yang model associated when condition.

Yang model:

leaf password-type {
   type enumeration {
      enum null;
      enum simple;
      enum cipher;
   }
}

leaf password-text {
type string;
when "../password-type != null";
}

I config these two leafs as below:
<password-type>simple</password-type>
<password-text>123456</password-text>

And I changed password-type to null, I get the config like below:
<password-type>null</password-type>

And then, I reconfig the password-type to simple, what data should be returned?

Is
  <password-type>simple</password-type>

Or

  <password-type>simple</password-type>
  <password-text>123456</password-type>