Re: [yang-doctors] Fwd: Re: Issue with ietf-dslite@2017-11-15.yang and yangdump-pro

Andy Bierman <andy@yumaworks.com> Fri, 22 December 2017 18:54 UTC

Return-Path: <andy@yumaworks.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 2229D124BFA for <yang-doctors@ietfa.amsl.com>; Fri, 22 Dec 2017 10:54:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.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 VNNW0R4ewF4h for <yang-doctors@ietfa.amsl.com>; Fri, 22 Dec 2017 10:54:09 -0800 (PST)
Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com [IPv6:2a00:1450:4010:c07::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D6A681200B9 for <yang-doctors@ietf.org>; Fri, 22 Dec 2017 10:54:08 -0800 (PST)
Received: by mail-lf0-x236.google.com with SMTP id e30so15618739lfb.9 for <yang-doctors@ietf.org>; Fri, 22 Dec 2017 10:54:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yy1iqC6VA93AiJCW3wNt9z+vPCP7XyEEaqvBnXvEkkQ=; b=EE5TFu3eKU3wYCanPncJcEFYnMkuSEHzplhZRKLITBaSyBaFSgq5LzD9bYknPFLjR0 EyWCCEVFWX07rrRtv4K1U6gL8arTkIOjeTIY7OrTq/Xit1SGaxU08FUMkm2dmgjNw8j2 p/mBS5wLCPU0OJXxKnxg41iWRSGJWSMocU7boRx6hXvMZT63L2gX/VRVJNUfuvdWpsOT 3xSG8pTFPJpPXjWau4GAp/Q2jUgq7qZoMeoKNSg0RfDZuscobXzbPjUhYkPsWG72yBep hK9yI0SOGU2Ce4YBUfADOqIWRF5DugZzpWhq8MXc7MGhA6Hct+Jvmm0meZG6siNZXkyH QwaA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yy1iqC6VA93AiJCW3wNt9z+vPCP7XyEEaqvBnXvEkkQ=; b=GdFZ7yoxBLGsq3q6ECqAiyxh2AkD66yo6wA/7pZPZYYn2jfIgAanwJHgJmRs1vcOjE euO9EaM/1YbY0j+tlPOF/tK3pjHD3EguFSXUzikWxely2eKcHhAIuvOwyC0Gf2RiH0fs oSWRouuMSYgprGoKa8fbna52wgYckpQw7HXaUnO3opKZLUrRjoke7Otb/4jdphiiW44i CDzTqYk1KWe2wbodO08BIbIwszSYzwDCUX5iDfW9hYX1PxjL9xb8zeaS2jMN02Kj3sJ0 ZLnXbXPfN3ph+IwBtp5ktCQ0H+GF7EIfaAZlkxyLnJc9FoLM9La6k61scv+zsyALcBg2 a1vw==
X-Gm-Message-State: AKGB3mJAlphG3DgxFzjv9c6zMi/qoqfjDZRcRnQFdMP7wNtSVjtZGySe 2dgOn74zNfVuUm6S1PPBvLUKpoRiBfAg6fbcDk3FBw==
X-Google-Smtp-Source: ACJfBothJYFtt3hPNqgcI9P07z3r31VHeq/PHw6aGTKwRQW4M2nq8OA/7D7kwCRG0tevykLb8EGH1hbPsijMdOewgZw=
X-Received: by 10.46.83.9 with SMTP id h9mr9383000ljb.68.1513968846958; Fri, 22 Dec 2017 10:54:06 -0800 (PST)
MIME-Version: 1.0
Received: by 10.25.33.81 with HTTP; Fri, 22 Dec 2017 10:54:06 -0800 (PST)
In-Reply-To: <ae339851-851d-05fd-f7ab-a33345a858cf@cesnet.cz>
References: <CABCOCHQkjNSte2ONpT4zRzbEzNtm7sUtEd9TwPcmoe_nz09fJA@mail.gmail.com> <beee188d-d505-1378-f01c-96352d23cf98@cisco.com> <ae339851-851d-05fd-f7ab-a33345a858cf@cesnet.cz>
From: Andy Bierman <andy@yumaworks.com>
Date: Fri, 22 Dec 2017 10:54:06 -0800
Message-ID: <CABCOCHQNga26AJgHhrk-rHTVhunJpqv--pUCum1RHaQeSJ+Tvw@mail.gmail.com>
To: Radek Krejčí <rkrejci@cesnet.cz>
Cc: Benoit Claise <bclaise@cisco.com>, Mahesh Jethanandani <mjethanandani@gmail.com>, Michal Vaško <mvasko@cesnet.cz>, YANG Doctors <yang-doctors@ietf.org>
Content-Type: multipart/alternative; boundary="f4030436096e5330690560f25729"
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/qTuZqR4Iqc95n5ZNx-OXCM6gMz4>
Subject: Re: [yang-doctors] Fwd: Re: Issue with ietf-dslite@2017-11-15.yang and yangdump-pro
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.22
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: Fri, 22 Dec 2017 18:54:12 -0000

On Fri, Dec 15, 2017 at 4:38 AM, Radek Krejčí <rkrejci@cesnet.cz> wrote:

> Hi,
> I'm adding Michal Vasko to cc, he knows better how these things are
> checked in libyang.
>
> It seems to me that Andy refers the text which does not apply here. The
> identity name was used as part of XPath expresion (when-stmt), so the
> definition of the context nodes for the when-stmt (RFC 7950, sec 7.21.5)
> and XPath context rules should apply here. Not the rules for the
> identityref's base statement. In this case, the when-stmt is in augment so
> the context node (which we also understand as the current node in this
> case) is the augment's target node. And according to XPath context rules
> (RFC 7950, sec 6.4.1):
>
>  o  Names without a namespace prefix belong to the same namespace as the
> identifier of the current node.
>


I cc:ed YANG doctors to get more opinions...

The current node is the augment-stmt.
Note that it does not say context node, which is the target of the augment.
I think prefixes (and default prefix) are resolved in the module containing
the statement.


module foo {

   import bar { prefix b; }
   identity X;

   augment b:/some-node {
      leaf test {
         type string;
         when "/b:some-node/b:other-node = 'X'";
      }
   }
}

module bar {

   identity W;
   identity X { base W; }
   container some-node {
       leaf other-node {
         type identityref { base W; }
       }
   }
}

Q) Does other-node = 'X' resolve to foo:X or bar:X?  IMO: foo:X



Andy



> In this particular case, the augment node with the when-stmt augments the
> same module which defines napt44, so they are in the correct namespace and
> the identity name can be used without the prefix. So it should be fine,
> while I believe that using prefix in the cases of identities is always
> better approach. From the first sight (it may be challenging for human to
> correctly resolve the context/current node in some cases), I would also
> expect prefix.
>
> I propose to keep the change in the draft (added nat prefix), since it
> improves readability of the expression. But I don't think that it is an
> error to ommit the prefix.
>
> Regards,
> Radek
>
>
> Dne 19.11.2017 v 20:42 Benoit Claise napsal(a):
> > Hi Radek,
> >
> > Here is a bug report for you.
> >
> > Regards, Benoit
> >
> >
> > -------- Forwarded Message --------
> > Subject:      Re: Issue with ietf-dslite@2017-11-15.yang and
> yangdump-pro
> > Date:         Sat, 18 Nov 2017 13:22:58 -0800
> > From:         Andy Bierman <andy@yumaworks.com>
> > To:   Benoit Claise <bclaise@cisco.com>
> > CC:   draft-ietf-softwire-dslite-yang@ietf.org <
> draft-ietf-softwire-dslite-yang@ietf.org>, Mahesh Jethanandani <
> mjethanandani@gmail.com>
> >
> >
> >
> > Hi,
> >
> > yangdump-pro is correct. Every other compiler missed it...
> >
> > 9.10.2.  The identityref's "base" Statement
> >
> >    The "base" statement, which is a substatement to the "type"
> >    statement, MUST be present at least once if the type is
> >    "identityref".  The argument is the name of an identity, as defined
> >    by an "identity" statement.  If a prefix is present on the identity
> >    name, it refers to an identity defined in the module that was
> >    imported with that prefix.  *Otherwise, an identity with the matching
> name MUST be defined in the current module or an included submodule.*
> >
> > Using ietf-dslite@2017-11-15.yang and ietf-nat@2017-11-15.yang
> >
> > When I change 'natp44' to 'nat:natp44' in both when-stmts:
> >
> > andy@andy-homedev:~/Desktop/FD1289/IETF$ yangdump-pro
> ietf-dslite@2017-11-15.yang modpath=.
> >
> > *** /home/andy/Desktop/FD1289/IETF/ietf-dslite@2017-11-15.yang
> > *** 0 Errors, 0 Warnings
> >
> > andy@andy-homedev:~/Desktop/FD1289/IETF$
> >
> >
> > Andy
> >
> >
> > On Sat, Nov 18, 2017 at 11:07 AM, Benoit Claise <bclaise@cisco.com
> <mailto:bclaise@cisco.com>> wrote:
> >
> >     Hi Andy,
> >
> >     Can you please have a look at ietf-dslite@2017-11-15.yang at
> http://www.claise.be/IETFYANGPageCompilation.html <http://www.claise.be/
> IETFYANGPageCompilation.html> .
> >     yangdump-pro reports a new error, while the other validators are
> fine.
> >
> >     Copying Mahesh, as YANG doctor.
> >
> >     Regards, Benoit
> >
> >
> >
>
>
>