Subject: Re: [yang-doctors] Could you kindly check my SUPA Yang file?

From: Benoit Claise <[email-masked]>
Date: Mon, 3 Oct 2016 18:48:16 +0200

Hi YANG doctors,

Could you please help John with his YANG module.
See http://www.claise.be/IETFYANGPageCompilation.html 
<http://www.claise.be/IETFYANGPageCompilation.html>, search for 
draft-ietf-supa-generic-policy-data-model-01.txt

Regards, Benoit
> Hi Benoit,
>
> I saw these in my build. These are exactly the same errors as were 
> reported in the -00 version. All are of the form:
>
>         leaf-list supa-has-policy-metadata-agg-ptr {
>             type instance-identifier;
>             must "derived-from-or-self (deref(.)/entity-class,
>                   SUPA-HAS-POLICY-METADATA-ASSOC)";
>
> the error has to do with the second argument. This second argument has 
> NOT changed, and at the time, I believe that we were told to ignore 
> this, as the second argument is in fact a literal, and several YANG 
> doctors told us that this syntax was correct.
>
> If you could verify that this is indeed an error, and put us in touch 
> with a YANG doctor that can help fix it, then of course we would be 
> happy to do so.
>
> thanks and kind regards,
> John
>
> On Mon, Oct 3, 2016 at 3:04 AM, Benoit Claise <[email-masked] 
> <mailto:[email-masked]>> wrote:
>
>     Hi John,
>
>     Sorry for the delay.
>     I see that you posted your new draft version.
>     So you can see the result at
>     http://www.claise.be/IETFYANGPageCompilation.html
>     <http://www.claise.be/IETFYANGPageCompilation.html>
>     It fails with "xpath error"
>
>     Regards, B.
>>     It works for me, but I don't trust my install...
>>
>>     thanks Benoit!
>>
>>     -- 
>>     regards,
>>     John
>
>
>
>
> -- 
> regards,
> John

---

From: Andy Bierman <[email-masked]>
Date: Mon, 3 Oct 2016 09:50:37 -0700

Hi,

An XPath literal has single or double quotes around it.
An unquoted string is interpreted as a number or a node-set

Andy

On Mon, Oct 3, 2016 at 9:48 AM, Benoit Claise <[email-masked]> wrote:

> See http://www.claise.be/IETFYANGPageCompilation.html, search for
> the error has to do with the second argument. This second argument has NOT
> changed, and at the time, I believe that we were told to ignore this, as
> the second argument is in fact a literal, and several YANG doctors told us
> that this syntax was correct.
>
> If you could verify that this is indeed an error, and put us in touch with
> a YANG doctor that can help fix it, then of course we would be happy to do
> so.
>
> thanks and kind regards,
> John
>
> On Mon, Oct 3, 2016 at 3:04 AM, Benoit Claise <[email-masked]> wrote:
>
>> Hi John,
>>
>> Sorry for the delay.
>> So you can see the result at http://www.claise.be/IETFYANGP
>> ageCompilation.html
> _______________________________________________
> yang-doctors mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/yang-doctors
>
>

---

From: Andy Bierman <[email-masked]>
Date: Mon, 3 Oct 2016 11:30:47 -0700

Hi,

Here are the errors and warnings that yangdump-pro is reporting.
I have not verified any of them, but this might be useful to add to
your pyang error messages

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 03 Oct 2016 20:54:56 +0200 (CEST)

> > with a YANG doctor that can help fix it, then of course we would be

The second argument to "derived-from-or-self" should be a string.  To
keep it short; in this case it should be:

             must "derived-from-or-self (deref(.)/entity-class,
                   'SUPA-HAS-POLICY-METADATA-ASSOC')";

/martin

---

From: Benoit Claise <[email-masked]>
Date: Thu, 6 Oct 2016 18:38:09 +0200

> your pyang error messages
Done by Martin with the latest pyang version from github. Thanks Martin

    There is one real error that current confdc/pyang doesn't detect:

    Error: leaf 'entity-class' has invalid default value (POLICY-OBJECT-TYPE)
    [email-masked]:271.13: error(258): invalid value

    This is an old bug that I recently fixed in both pyang and yanger.
    You will now get this error:

    [email-masked]:274: error: the value "POLICY-OBJECT-TYPE" does not match its base type - identityref not derived from POLICY-OBJECT-TYPE

http://www.claise.be/IETFYANGPageCompilation.html is now showing the 
pyang error.

Regards, Benoit
>
>
> Andy
>
>
> On Mon, Oct 3, 2016 at 9:48 AM, Benoit Claise <[email-masked] 
>>     I saw these in my build. These are exactly the same errors as
>>     were reported in the -00 version. All are of the form:
>>
>>     the error has to do with the second argument. This second
>>     argument has NOT changed, and at the time, I believe that we were
>>     told to ignore this, as the second argument is in fact a literal,
>>     and several YANG doctors told us that this syntax was correct.
>>
>>     If you could verify that this is indeed an error, and put us in
>>     touch with a YANG doctor that can help fix it, then of course we
>>     would be happy to do so.
>>
>>     thanks and kind regards,
>>     John
>>
>     [email-masked] <mailto:[email-masked]>
>     <https://www.ietf.org/mailman/listinfo/yang-doctors>
>
>

---

From: Joel Halpern <[email-masked]>
Date: Thu, 6 Oct 2016 17:11:56 +0000

Given that POLICY-OBHECT-TYPE is POLICY-OBJHECT-TYPE, can you explain what the actual error is?

Thank you,
Joel

From: Benoit Claise [mailto:[email-masked]]
Sent: Thursday, October 06, 2016 6:38 PM
To: Andy Bierman <[email-masked]>
Cc: John Strassner <[email-masked]>; YANG Doctors <[email-masked]>; [email-masked]; Per Hedeland <[email-masked]>
Subject: Re: [yang-doctors] Could you kindly check my SUPA Yang file?

[email-masked]:271.13<mailto:[email-masked]:271.13>: error(258): invalid value

[email-masked]:274<mailto:[email-masked]:274>: error: the value "POLICY-OBJECT-TYPE" does not match its base type - identityref not derived from POLICY-OBJECT-TYPE
http://www.claise.be/IETFYANGPageCompilation.html is now showing the pyang error.

Regards, Benoit

Andy

On Mon, Oct 3, 2016 at 9:48 AM, Benoit Claise <[email-masked]<mailto:[email-masked]>> wrote:
Hi YANG doctors,

Could you please help John with his YANG module.
See http://www.claise.be/IETFYANGPageCompilation.html, search for draft-ietf-supa-generic-policy-data-model-01.txt

Regards, Benoit
Hi Benoit,

I saw these in my build. These are exactly the same errors as were reported in the -00 version. All are of the form:

the error has to do with the second argument. This second argument has NOT changed, and at the time, I believe that we were told to ignore this, as the second argument is in fact a literal, and several YANG doctors told us that this syntax was correct.

If you could verify that this is indeed an error, and put us in touch with a YANG doctor that can help fix it, then of course we would be happy to do so.

thanks and kind regards,
John

On Mon, Oct 3, 2016 at 3:04 AM, Benoit Claise <[email-masked]<mailto:[email-masked]>> wrote:
Hi John,

Sorry for the delay.
I see that you posted your new draft version.
So you can see the result at http://www.claise.be/IETFYANGPageCompilation.html
It fails with "xpath error"

Regards, B.

thanks Benoit!

--
regards,
John

--
regards,
John

_______________________________________________
yang-doctors mailing list
[email-masked]<mailto:[email-masked]>
https://www.ietf.org/mailman/listinfo/yang-doctors

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 06 Oct 2016 19:24:43 +0200 (CEST)

> what the actual error is?

I'm not sure what you actually wrote above, but the error is:

  error: the value "POLICY-OBJECT-TYPE" does not match its base type -
  identityref not derived from POLICY-OBJECT-TYPE

Note section 7.18.2 in RFC 7950 which says about identity derivation:

   o  It is irreflexive, which means that an identity is not derived
      from itself.

/martin

> Cc: John Strassner <[email-masked]>; YANG Doctors
> <[email-masked]>;
> [email-masked]; Per Hedeland
> <[email-masked]>
> [email-masked]:274<mailto:[email-masked]:274>:
> error: the value "POLICY-OBJECT-TYPE" does not match its base type -
> identityref not derived from POLICY-OBJECT-TYPE
> On Mon, Oct 3, 2016 at 9:48 AM, Benoit Claise
> <[email-masked]<mailto:[email-masked]>> wrote:
> Hi YANG doctors,
> 
> On Mon, Oct 3, 2016 at 3:04 AM, Benoit Claise
> <[email-masked]<mailto:[email-masked]>> wrote:
> Hi John,
> 
> Sorry for the delay.

---

From: Joel Halpern <[email-masked]>
Date: Thu, 6 Oct 2016 17:52:41 +0000

I have tried to match the four errors against the code.
There are two places where we use POLICY-OBJECT-TYPE as a default value.  One of them is an error, because we actually mean a different derived identity.  But the first one is correct.  The grouping policy-object-type is defining the entity-class leaf as an identityref based on POLICY-OBJECT-TYPE, and its default is the derivation root (which is the only value defined in that tree up to that point in the document.

We then use POLICY-OBJECT-TYPE in two must clauses for derived-from-or-self because we want to allow the instance identifier to point to anything of POLICY OBJECT TYPE or derived from POLICY OBJECT TYPE.

The only semantic error is that supa-policy-component-structure type, when it uses the supa-policy-object-type grouping should be using the POLICY-COMPONENT-TYPE identity instead of the POLICY-OBJECT-TYPE.  But I can not figure out why that would produce a PYANG error.

Yours,
Joel

-----Original Message-----
From: Martin Bjorklund [mailto:[email-masked]] 
Sent: Thursday, October 06, 2016 7:25 PM
To: Joel Halpern <[email-masked]>
Cc: [email-masked]; [email-masked]; [email-masked]; [email-masked]; [email-masked]; [email-masked]
Subject: Re: [yang-doctors] Could you kindly check my SUPA Yang file?

/martin

> your pyang error messages Done by Martin with the latest pyang version 
> from github. Thanks Martin
>

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 06 Oct 2016 20:06:52 +0200 (CEST)

Joel Halpern <[email-masked]> wrote:
> There are two places where we use POLICY-OBJECT-TYPE as a default
> value.  One of them is an error, because we actually mean a different
> derived identity.  But the first one is correct.  The grouping
> policy-object-type is defining the entity-class leaf as an identityref
> based on POLICY-OBJECT-TYPE, and its default is the derivation root
> (which is the only value defined in that tree up to that point in the
> document.

But since an identity is not derived from itself (by definition), the
default value cannot be the same as the identityref's base.

/martin

---

From: Joel Halpern <[email-masked]>
Date: Thu, 6 Oct 2016 18:48:34 +0000

Are you really saying we need to put a dummy parent in the identity chain just so easy can use the starting point as a default? Defaults must be derived from the base, not be the base?

Yours,
Joel

Sent from my Android phone using TouchDown (www.symantec.com)

-----Original Message-----
From: Martin Bjorklund [[email-masked]]
Received: Thursday, 06 Oct 2016, 8:07PM
To: Joel Halpern [[email-masked]]
CC: [email-masked] [[email-masked]]; [email-masked] [[email-masked]]; [email-masked] [[email-masked]]; [email-masked] [[email-masked]]; [email-masked] [[email-masked]]; [email-masked] [[email-masked]]
Subject: Re: [yang-doctors] Could you kindly check my SUPA Yang file?

/martin

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 06 Oct 2016 20:58:38 +0200 (CEST)

Joel Halpern <[email-masked]> wrote:
> Are you really saying we need to put a dummy parent in the identity
> chain just so easy can use the starting point as a default? Defaults
> must be derived from the base, not be the base?

Yes.  Or rather, defaults must be valid values, and valid values must
be derived from the base.

There were some ideas for doing more clever things with identities,
such as defining an identity as abstract, but there were never any
concrete proposals, so here we are.

/martin

> CC: [email-masked] [[email-masked]]; [email-masked]
> [[email-masked]]; [email-masked] [[email-masked]];
> [email-masked] [[email-masked]];
> [email-masked]
> [[email-masked]];
> [email-masked] [[email-masked]]

---

From: Joel Halpern <[email-masked]>
Date: Thu, 6 Oct 2016 19:02:06 +0000

Okay, I found the text that says that the base definition of an identity is not a valid value for that identity.  Seems like a rather odd rule.  But we will add dummy top identities to the three identity trees we use.

Yours,
Joel

-----Original Message-----
From: Martin Bjorklund [mailto:[email-masked]] 
Sent: Thursday, October 06, 2016 8:07 PM
To: Joel Halpern <[email-masked]>
Cc: [email-masked]; [email-masked]; [email-masked]; [email-masked]; [email-masked]; [email-masked]
Subject: Re: [yang-doctors] Could you kindly check my SUPA Yang file?

> (which is the only value defined in that tree up to that point in the 

But since an identity is not derived from itself (by definition), the default value cannot be the same as the identityref's base.

/martin

---

From: John Strassner <[email-masked]>
Date: Thu, 6 Oct 2016 12:12:44 -0700

Hi all,

I think I finally follow. Thank you Andy, Martin, and Benoit for your
help! Joel and I will work to fix this and upload a new version in the next
couple of days.
BTW, the POLICY-OBJECT-TYPE goof was mine, not Joel's. :-)

best regards,
John

On Thu, Oct 6, 2016 at 12:02 PM, Joel Halpern <[email-masked]>
wrote:

> Okay, I found the text that says that the base definition of an identity
> is not a valid value for that identity.  Seems like a rather odd rule.  But
> we will add dummy top identities to the three identity trees we use.
>
> Yours,
> Joel
>
> Cc: [email-masked]; [email-masked]; [email-masked];
> [email-masked]; [email-masked];
> [email-masked]

-- 
regards,
John