[yang-doctors] Checking for parent path in grouping

"Acee Lindem (acee)" <acee@cisco.com> Tue, 02 April 2019 19:33 UTC

Return-Path: <acee@cisco.com>
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 9D5EE120188 for <yang-doctors@ietfa.amsl.com>; Tue, 2 Apr 2019 12:33:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.501
X-Spam-Level:
X-Spam-Status: No, score=-14.501 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com header.b=lNheCzom; dkim=pass (1024-bit key) header.d=cisco.onmicrosoft.com header.b=dGvYoen6
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 AnfYJmi-k-FP for <yang-doctors@ietfa.amsl.com>; Tue, 2 Apr 2019 12:33:29 -0700 (PDT)
Received: from alln-iport-3.cisco.com (alln-iport-3.cisco.com [173.37.142.90]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B407812011C for <yang-doctors@ietf.org>; Tue, 2 Apr 2019 12:33:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=7395; q=dns/txt; s=iport; t=1554233609; x=1555443209; h=from:to:subject:date:message-id:mime-version; bh=6HphSyOvtWUrPIIgODXD8IVUetVWbUvbCEw1WSbrG2c=; b=lNheCzomcckbSjcJ8gbLOTAdaWFKUzWmPegsEFfSvvcE+uG3N9pxxdBn MzBuWCgiTqGEj3O6iaZkZEuZSg1e2OpsCFv1lLO2cHkH37bsOeE8fqZM6 jI5Pa6t+0ZzCJ7uUlXQwFOtW31txtQZpQpQy4erux03+/PvY0yk/SLbJU o=;
IronPort-PHdr: 9a23:sPAEHR8RGRPfsP9uRHGN82YQeigqvan1NQcJ650hzqhDabmn44+/YR7E/fs4iljPUM2b8P9Ch+fM+4HYEW0bqdfJq3UeaNpJXh4Bh98RmlkpC8OIIUb6N/XtKSc9GZcKWQ==
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0AnAADrt6Nc/4MNJK1lHAEBAQQBAQcEAQGBUQcBAQsBgQ4vUANodAQLJwqEBINHA4RSimZKlFWESYEugSQDVA4BASyEWYUlIjQJDQEBAwEBCQEDAm0cDIV0HQEBOBEBSgIEMCcEgzUBgRFMAxUBoysCihRxgS+CeQEBBYJGgjwYggwIgS8BizIXgX+BOB+CHgEBiDgxgiaNBYQlk01gCQKCApFkGpQ4nyICBAIEBQIOAQEFgU04gVZwFWUBgkGCCoNuilNygSiODQGBHgEB
X-IronPort-AV: E=Sophos;i="5.60,301,1549929600"; d="scan'208,217";a="256695599"
Received: from alln-core-1.cisco.com ([173.36.13.131]) by alln-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 02 Apr 2019 19:33:28 +0000
Received: from XCH-ALN-003.cisco.com (xch-aln-003.cisco.com [173.36.7.13]) by alln-core-1.cisco.com (8.15.2/8.15.2) with ESMTPS id x32JXSUq015280 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL) for <yang-doctors@ietf.org>; Tue, 2 Apr 2019 19:33:28 GMT
Received: from xhs-rtp-001.cisco.com (64.101.210.228) by XCH-ALN-003.cisco.com (173.36.7.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 2 Apr 2019 14:33:27 -0500
Received: from xhs-rtp-002.cisco.com (64.101.210.229) by xhs-rtp-001.cisco.com (64.101.210.228) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 2 Apr 2019 15:33:26 -0400
Received: from NAM02-CY1-obe.outbound.protection.outlook.com (64.101.32.56) by xhs-rtp-002.cisco.com (64.101.210.229) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 2 Apr 2019 15:33:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.onmicrosoft.com; s=selector1-cisco-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6HphSyOvtWUrPIIgODXD8IVUetVWbUvbCEw1WSbrG2c=; b=dGvYoen69N1kkCynlVtuVq1ALx6Zr17gC2CPgnyPwRMFKF+lgMsRNSoPe9JXiMPPnHE6mbYqYi3Gy3GIIAv9bARhkQ58Fghpjx/CfeAEt3/YuGQzJ5S/w7iUjRqBmfYmgdOc+PXWoyiu58/otJTpwC8rQZLKUIULs4J5FFeR1kc=
Received: from BN6PR1101MB2226.namprd11.prod.outlook.com (10.174.112.11) by BN6PR1101MB2211.namprd11.prod.outlook.com (10.174.112.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.15; Tue, 2 Apr 2019 19:33:25 +0000
Received: from BN6PR1101MB2226.namprd11.prod.outlook.com ([fe80::9c05:e282:840b:51a1]) by BN6PR1101MB2226.namprd11.prod.outlook.com ([fe80::9c05:e282:840b:51a1%8]) with mapi id 15.20.1750.017; Tue, 2 Apr 2019 19:33:25 +0000
From: "Acee Lindem (acee)" <acee@cisco.com>
To: YANG Doctors <yang-doctors@ietf.org>
Thread-Topic: Checking for parent path in grouping
Thread-Index: AQHU6YrwgoE9Gu1sBUCnh32lTPiEXQ==
Date: Tue, 02 Apr 2019 19:33:25 +0000
Message-ID: <D8075959-82D6-44B3-B54C-5703EF544961@cisco.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=acee@cisco.com;
x-originating-ip: [173.38.117.82]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 932e3503-7a42-4380-22d2-08d6b7a2135a
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:BN6PR1101MB2211;
x-ms-traffictypediagnostic: BN6PR1101MB2211:
x-ms-exchange-purlcount: 2
x-microsoft-antispam-prvs: <BN6PR1101MB221167AF71BB14F3FD45C14AC2560@BN6PR1101MB2211.namprd11.prod.outlook.com>
x-forefront-prvs: 0995196AA2
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(39860400002)(136003)(376002)(346002)(189003)(199004)(26005)(102836004)(99286004)(4744005)(186003)(6116002)(6486002)(97736004)(6306002)(2616005)(83716004)(3846002)(6512007)(256004)(476003)(25786009)(486006)(6436002)(54896002)(71190400001)(36756003)(66066001)(105586002)(71200400001)(53936002)(6506007)(8936002)(82746002)(86362001)(2906002)(106356001)(7736002)(68736007)(6916009)(5660300002)(478600001)(33656002)(8676002)(14454004)(316002)(81166006)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1101MB2211; H:BN6PR1101MB2226.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: cisco.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: 9WZXF68OO7U5zNV5/2W/p03SJkhIO34Mlp/UxCNh/YdOpL8a28f8lUNGp6SNIM+rywtTo0F1Z7EH+NeS0bMUboEYCg2Kyr8a+EEtgLqL7/JUnZT6ehIaltFca6urRvEsrayY2XRWFjxxWGK17L83OLWP1Oasp1vPdBsMrRUavEOtSciFGMOt28AWCsrk1a+XoaZmNupjW+8PkexgXXBYZ8bqYZWcGIstg/3YpypBVJreDuekPWbWdPR+XdsQ5amK4QY9ONLchkqH30iyBZ+41571pYItm5jjLw7KUxDWQGezRN1zeJp+kOH9ato0pChrFsJkOhXlz623UUy+1Fj3ROaF9wcjpKrsWEdEYtkWuXZrTOjWSQ4tdot+qFlV7Qp+3wr3y38U8wN4p+PRNK96xFXc9kIPERLbvW+MOL8Swi0=
Content-Type: multipart/alternative; boundary="_000_D807595982D644B3B54C5703EF544961ciscocom_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 932e3503-7a42-4380-22d2-08d6b7a2135a
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Apr 2019 19:33:25.3960 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2211
X-OriginatorOrg: cisco.com
X-Outbound-SMTP-Client: 173.36.7.13, xch-aln-003.cisco.com
X-Outbound-Node: alln-core-1.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/PEy_bungzXMzzMIZ0h1EJ2Z9psk>
Subject: [yang-doctors] Checking for parent path in grouping
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: Tue, 02 Apr 2019 19:33:32 -0000

Is there a way to check for particular parent path so that a container or leaf in a grouping would be present ONLY when it  is “used” from a particular path? For example:

grouping foo {
  container foo {
    container red {
         when “../../red-parent”;
    }
    container blue {
          when “../../blue-parent”;
     }
   }
}


container red-parent {
  uses foo;
}
 container blue-parent {
   uses foo;
}

It compiled fine using pyang but the check didn’t exclude the container with the non-matching parent from the path in the formatted tree (pyang -f tree output).

Thanks,
Acee