[netmod] Augmentation with a mandatory leaf in a submodule - Is the following legal?

"Beauville, Yves (Nokia - BE/Antwerp)" <yves.beauville@nokia.com> Fri, 15 February 2019 09:12 UTC

Return-Path: <yves.beauville@nokia.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 BF452130F5F for <netmod@ietfa.amsl.com>; Fri, 15 Feb 2019 01:12:44 -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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nokia.onmicrosoft.com
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 WF1DQTZ8lUA7 for <netmod@ietfa.amsl.com>; Fri, 15 Feb 2019 01:12:41 -0800 (PST)
Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140092.outbound.protection.outlook.com [40.107.14.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5CB40130F28 for <netmod@ietf.org>; Fri, 15 Feb 2019 01:12:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Uy1QTll3yjsipuSjO4bLj5kH1d68Mbr0zy4QEyUWxlE=; b=Lm75rQ5euxUXRsu/bjFn9eYStChGjj6KiC5wZqc2Z4T7lBtCl9BS9aUwd49PsHHM77ySmx7jNhi4b2GmgcfZULk4vai1blLp93B3yurQbExpJpqwvamqNeOLZDVvQqyG+P5YsEo7WvE5r+rju9RXtCvFVPk2xzsjHeDv8p5fuBU=
Received: from VI1PR07MB5792.eurprd07.prod.outlook.com (20.178.121.222) by VI1PR07MB4559.eurprd07.prod.outlook.com (20.177.56.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.12; Fri, 15 Feb 2019 09:12:26 +0000
Received: from VI1PR07MB5792.eurprd07.prod.outlook.com ([fe80::b1cf:d9b9:6654:e6bf]) by VI1PR07MB5792.eurprd07.prod.outlook.com ([fe80::b1cf:d9b9:6654:e6bf%4]) with mapi id 15.20.1643.008; Fri, 15 Feb 2019 09:12:26 +0000
From: "Beauville, Yves (Nokia - BE/Antwerp)" <yves.beauville@nokia.com>
To: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: Augmentation with a mandatory leaf in a submodule - Is the following legal?
Thread-Index: AQHUxQ6Rb/ufk4ALnEO3ok4pna4OcQ==
Date: Fri, 15 Feb 2019 09:12:25 +0000
Message-ID: <6b988ca0-7634-6a57-e984-6553f8f706b7@nokia.com>
Accept-Language: fr-BE, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [131.228.32.166]
user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0
x-clientproxiedby: LO2P265CA0189.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a::33) To VI1PR07MB5792.eurprd07.prod.outlook.com (2603:10a6:803:cf::30)
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: b4c25855-47a9-4e12-9bc4-08d69325b3a7
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7193020); SRVR:VI1PR07MB4559;
x-ms-traffictypediagnostic: VI1PR07MB4559:
x-ms-exchange-purlcount: 3
x-microsoft-exchange-diagnostics: 1;VI1PR07MB4559;23:BiBawZq+9+aqi6R6tIrczQ41GhzjyNm1DqrT6KPnEs12bX7xMU20dX4g0xirsAvBi2h4qv7CmiZGda9aLFXEJmofz9X+kPDMImxFZeu5kh1qz05yFSQDzZWoqmRm0ZOPwWj5fJJ8bkNffpFKiutXS1rUW4s8MywIIud4kN5+S9Qt1l/qBmH+3NryIsplVLttFkOR1FjVe7sHclzzTlwYW4uZu5MSXBeRq5tnl0j6Qwe9Ih0u28AdrLv5yC/HLqApWnvKkmCYAG8URVW4ydS+dYr8LGne49CvVHh9BHIJ77vh0Qym98KMBadvnd3ZQDbUSKbeK1LaDtpCKK+g09NQ3ljz3RwsshzX8Iv0TkfgmeYaAjkwU/MGoj+dJduqGKoQ6g59zV97YFcOukLPqqsobmTwBkmht2FPF9C63o0S4Ct/cS410uClVx8nHzZBeM0D/zCLA9x4kxSdB5FBoZHeq5ulQrVa3d5Wylkw5PLZuZk3T9+aqri00QPWhdPHfd4Gai9j2y7LheXxjtKZvyoN2mZa+VxVhaZ8gsccI8oT0NBM6hRHgZYQt2+shqS5DaRR+t9kLKGDXNBTPJt0Lb9cHiOJ0lybh6As5O+/MWIhn90lyNax6FDY4dvhpt3cZ9CVge8iIx62T+en4F1m9TvFrVIfOsMcVWfPYYtbHihN8+slHTmbCJ2JVCzgh0MCFbI9iZfQ/A8bi4Ws/J7sxuoguqAwS/XO67BiX9vyvAs+8RVYnYfHh6XvTaxJODHyXwLC0vRDhaT9b0yVS1XysH/wUtKDGr4B9spcR91r4OPD0FmCXHKKzoKKBfILiT8m1yQ+rKhcU8K9Yi0KG/ij1sZp8znRb8kuMOzkYvgvZe9uhMMr5FdlyTVQVOCi6DYFEK3a1oylDK+9O1xf4Vugs4TOrLiQVllWuaEqMditXA7ZY4PVsHBoOj4XL2aG2HWESfO7fMOuaAbGhShsIcvC8PpDce+3Y0Vd9bsRrhnt7h7ldMV9HgRuCepllDNgO5kbU2BAVhwP0K/tSIg9ihAFEb2VEXnpgU95KrWo2/d5sxaT2mTD3ulxSzk/szXFiZgcLoY7/yXip67hkiXlH8Pq9P74s2zHZnNtcNWdnWU8JL02a6dG3o2e9FNlfLL/TgVUiLnAcZaOgBWLlKJy6IK5DI2ACDciBrpgUY59CXDTPnHkbGAahsN40e7YUB4PByVexEgZwT7E4uJfhkyKZx4NCIjuNNqApGvgvOQgW0ZDTDC7ADzagX1d3uvlh16xpP/KcB/zmoK5YAqH8GeR2I8BhdlpCfi5G0YHZ7v8uC67YKAI+1abzbYZ66NQbAFCDyaKnJDovsID9gxZSMEiQmS+DNbLWs5Sy4dCgXS/7Qdu0PQAbGI=
x-microsoft-antispam-prvs: <VI1PR07MB4559BF6729E69DE9D8BC9DDA89600@VI1PR07MB4559.eurprd07.prod.outlook.com>
x-forefront-prvs: 09497C15EB
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(376002)(346002)(136003)(366004)(396003)(189003)(199004)(2906002)(8936002)(2351001)(26005)(102836004)(7736002)(8676002)(81156014)(486006)(476003)(2616005)(316002)(81166006)(1730700003)(58126008)(6346003)(186003)(106356001)(386003)(52116002)(6506007)(65956001)(65806001)(99286004)(606006)(66066001)(71190400001)(256004)(5640700003)(54896002)(31686004)(105586002)(6116002)(71200400001)(64126003)(2501003)(3846002)(65826007)(36756003)(6916009)(68736007)(86362001)(6306002)(6512007)(14444005)(6486002)(478600001)(25786009)(966005)(31696002)(14454004)(53936002)(6436002)(97736004)(236005); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB4559; H:VI1PR07MB5792.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: nokia.com does not designate permitted sender hosts)
authentication-results: spf=none (sender IP is ) smtp.mailfrom=yves.beauville@nokia.com;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: bFiabZ9zIm7sciQ8UzqGbX4ZuMvWSID2pNGXE6lEKsoTfV3wM8FrLawhhlURULh98jyqxDlX6liKuvHefsPIUxvXg1nSgUycn97x0NICO6xxAGNkTk5ELdC1xQXp5bF+VCv56fqAHfKuz88a5vBuzOqXFgxe4kQ85MWr8o3HKeXUZHirGU+Qjtdhh3BtxzQaDTt2J9yjxBg9FijSRK2gFCQGlSj+4h350ijOdbshLmZv6qTct6iSJhcX1kNxZX/SUMXmdN2koDDTzUH4/lDLAXI+inBZj6qBq91ynA43Xjc+usYUCUjDYqCY260YvnT6fWFrQwC2IDIY8AxAq6xMeHk1YR8D/+g4uVUUq7EaVhNXMZ/r36dWL0zLRKlYQ+36Uge9Kv86KuZkJ6u8LQev+X6DkYOY+5ngKD0PVN/8MKc=
Content-Type: multipart/alternative; boundary="_000_6b988ca076346a57e9846553f8f706b7nokiacom_"
MIME-Version: 1.0
X-OriginatorOrg: nokia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b4c25855-47a9-4e12-9bc4-08d69325b3a7
X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Feb 2019 09:12:25.3590 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB4559
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/unhiYU1AWcoFMKzUeTh50h4nrSo>
Subject: [netmod] Augmentation with a mandatory leaf in a submodule - Is the following legal?
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: Fri, 15 Feb 2019 09:12:45 -0000

Hi,

We are working with a submodule in which we are augmenting a container of the same module with a mandatory node. There is a small catch though.

Our YANG modules are actually supporting two augmentations - I have copied a trimmed down version of our modules at the end of this mail -:

* From container 'top' in 'module-a' to container 'first-augment' in 'module-b' (sub-module-1) => This augmentation is made conditional with a 'when' statement.

* From container 'first-augment' to leaf 'mandatory-leaf'. This is done within two submodules of the same module 'module-b' => This augmentation is NOT conditional.

The Open Daylight parser rejects our YANG modules with the following error:

   Failed to add augmentation sub-module-1b.yang defined at sub-module-2b.yang org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException: An augment cannot add node 'mandatory-leaf' because it is mandatory and in module different than target [at sub-module-2b.yang]

As per https://tools.ietf.org/html/rfc7950#section-7.17, we believe these augmentations are both legal'.

We have raised a ticket YANGTOOLS-956 at Open Daylight but folks at ODL are asking us to check with experts in this mailing list.

Can one assess if these models are making a 'legal' use of augmentations or not?

Yves

================================

module module-a {
  yang-version 1.1;
    namespace "http://www.example.com/anothermodule"<http://www.example.com/anothermodule>;
    prefix am;
    container top {
      leaf type {
        type string;
        mandatory true;
      }
  }
}
module module-b {
  yang-version 1.1;
    namespace "http://www.example.com/module-b"<http://www.example.com/module-b>;
   prefix mm;
   include sub-module-1;
   include sub-module-2;
}
submodule sub-module-1 {
   yang-version 1.1;
   belongs-to module-b {
    prefix mm;
  }
    import module-a {
    prefix am;
  }
  augment '/am:top' {
    when "am:type = 'test'";
    container first-augment {
    }
  }
}
submodule sub-module-2 {
  yang-version 1.1;
  belongs-to module-b {
    prefix mm;
  }
    import module-a {
    prefix am;
  }
  include sub-module-1;
  grouping dummygrouping {
    leaf mandatory-leaf {
      type string;
      mandatory true;
     }
  }
  augment '/am:top/mm:first-augment' {
    uses dummygrouping;
  }
}