Re: [netmod] implemented vs imported modules - checking XPath expressions

Ladislav Lhotka <lhotka@nic.cz> Tue, 08 November 2016 13:48 UTC

Return-Path: <lhotka@nic.cz>
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 6789E1294D8 for <netmod@ietfa.amsl.com>; Tue, 8 Nov 2016 05:48:35 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.497
X-Spam-Level:
X-Spam-Status: No, score=-8.497 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-1.497] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 HucFCaNlwrRa for <netmod@ietfa.amsl.com>; Tue, 8 Nov 2016 05:48:33 -0800 (PST)
Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BDE921294A0 for <netmod@ietf.org>; Tue, 8 Nov 2016 05:48:33 -0800 (PST)
Received: from [IPv6:2001:718:1a02:1:88b1:35bc:17ad:9763] (unknown [IPv6:2001:718:1a02:1:88b1:35bc:17ad:9763]) by mail.nic.cz (Postfix) with ESMTPSA id 7638E60CC5; Tue, 8 Nov 2016 14:48:32 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1478612912; bh=tRpw4LyIYJJN4n2TS4C+iAp8kTcsJcFoo+aMjq5WAyw=; h=From:Date:To; b=sT4IOxo1iT3H9Wytg2aLdtPbQ1PzcDd7loKlFQdWOf3B2ZXISJmAIZL0OrpeR44cK 2DswCKqsNl5YTQcJR4021VmTeTBHc3FHnI42GNpGQVkg7HPvshN5qIHsVdjs3TVcPY 8sqtTtVU1rFfOh+FmltIPc2U9D/UaFL4ZBqFqbk4=
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\))
From: Ladislav Lhotka <lhotka@nic.cz>
In-Reply-To: <cd6d25f1-81aa-3c4b-216e-90d66c1b27c3@cesnet.cz>
Date: Tue, 08 Nov 2016 14:48:32 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <3CC848F1-407B-4307-A895-FDBB67857538@nic.cz>
References: <cd6d25f1-81aa-3c4b-216e-90d66c1b27c3@cesnet.cz>
To: Radek Krejčí <rkrejci@cesnet.cz>
X-Mailer: Apple Mail (2.3251)
X-Virus-Scanned: clamav-milter 0.98.7 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/FYxVfHrzBYIGsakRYn4SYQnptiA>
Cc: netmod@ietf.org
Subject: Re: [netmod] implemented vs imported modules - checking XPath expressions
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, 08 Nov 2016 13:48:35 -0000

Hi Radek,

> On 8 Nov 2016, at 13:51, Radek Krejčí <rkrejci@cesnet.cz> wrote:
> 
> Hi,
> I have the following 3 modules and only the module c is initially
> implemented. Because the module a is targeted in c's augment, a must be
> also implemented. Since the b is not targeted in any augment nor
> leafref, it need not be implemented.
> 
> In such a case (a, c are implemented; b is imported), is the module c
> valid? It refers leaf b in the must expression, but the target leaf does

My take is that module c is valid, but leaf c cannot be present in the data because its "must" expression is always false. A clever tool might issue a warning.

> not exists (module b is not implemented, so it does not augments data in
> module a). Is there any way how the module c could specify that the
> imported module b must be also implemented?

Unfortunately, no. Andy's expired draft-bierman-netmod-yang-package-00 aimed at this.

Lada

> 
> module a {
>  ...
>  container a {
>    leaf a {
>      type string;
>    }
>  }
> }
> 
> module b {
>  ...
>  import a {
>    prefix a;
>  }
> 
>  augment /a:a {
>    leaf b {
>      type string;
>    }
>  }
> }
> 
> module c {
>  ...
>  import a {
>    prefix a;
>  }
>  import b {
>    prefix b;
>  }
> 
>  augment /a:a {
>    leaf c {
>      type string;
>      must "/a:a/b:b";
>    }
>  }
> }
> 
> Regards,
> Radek Krejci
> 
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C