Subject: Re: [Lime] reference a leaf instance that is not index or key of the list

From: Qin Wu <[email-masked]>
Date: Mon, 3 Aug 2015 00:50:46 +0000

FYI.
发件人: Andy Bierman [mailto:[email-masked]]
发送时间: 2015年7月31日 22:47
收件人: Qin Wu
主题: Re: [Lime] reference a leaf instance that is not index or key of the list

Hi,

It is called leafref because it can point at any leaf.
It does not have to be a key leaf.

Andy

On Fri, Jul 31, 2015 at 1:34 AM, Qin Wu <[email-masked]<mailto:[email-masked]>> wrote:
Hi, Andy:
In the path statement, can we reference a leaf instance that is not index or key of the list?
e.g., In draft-tissa-lime-yang-oam-model-05, the snippset of "admin-status" is defined as follows
"
    leaf admin-status {
      type leafref {
        path "/if:interfaces-state/if:interface/if:admin-status";
      }
      config false;
      description
        "oper status from ietf-interface module";
    }
"
In the path statement, admin-status reference if:admin-status defined in the RFC7223 which is not index or key for list interface in RFC7223?
Is this correct?

Also we have another example, here is the snippset of "oper-status" is defined as follows in In draft-tissa-lime-yang-oam-model-05
    leaf oper-status {
      type leafref {
        path "/if:interfaces-state/if:interface/if:oper-status";
      }
      config false;
      description
        "oper status from ietf-interface module";
    }
In the path statement for oper-status, oper-status also reference if:oper-status which is not index of key for list interface in tRFC7223?
Is this allowed?
BTW: This is something we discussed in the bits-n-bytes.

-Qin
> 发件人: Lime [mailto:[email-masked]<mailto:[email-masked]>] 代表 Qin Wu
> 发送时间: 2015年6月1日 21:03
> 收件人: [email-masked]<mailto:[email-masked]>
> 主题: [Lime] reference a leaf instance that is not index or key of the
> list
>
> Hi, All:
> I am not sure we can reference a leaf instance that is not index or key of the list. When I run the following pyang command:
> We have the following warning:
> “
> $ pyang -f uml ietf-gen-oam.yang -o goam.uml
> Info: Did not find leafref target
> /if:interfaces-state/if:interface/if:admin-sta
> tus
> Info: Did not find leafref target
> /if:interfaces-state/if:interface/if:oper-stat
> us
> Traceback (most recent call last):
>   File "c:/pyang-1.4.1/bin/pyang", line 333, in <module>
>     run()
>   File "c:/pyang-1.4.1/bin/pyang", line 328, in run
>     os.rename(tmpfile, o.outfile)
> WindowsError: [Error 183]
> ”
> Becos admin-status and oper-status are both not index or key in the interface list. Also admin-status is a optional parameter defined in the interface list.
> Comments?
>
> -Qin

---

From: Mahesh Jethanandani <[email-masked]>
Date: Sun, 2 Aug 2015 21:39:52 -0700

Does it mean the pyang error is a bug?

> On Aug 2, 2015, at 5:50 PM, Qin Wu <[email-masked]> wrote:
> 
> FYI.
> 发件人: Andy Bierman [mailto:[email-masked] <mailto:[email-masked]>] 
> 发送时间: 2015年7月31日 22:47
> 收件人: Qin Wu
> On Fri, Jul 31, 2015 at 1:34 AM, Qin Wu <[email-masked] <mailto:[email-masked]>> wrote:
> Hi, Andy:
> > 发件人: Lime [mailto:[email-masked] <mailto:[email-masked]>] 代表 Qin Wu
> > 发送时间: 2015年6月1日 21:03
> > 收件人: [email-masked] <mailto:[email-masked]>
> _______________________________________________
> Lime mailing list
> [email-masked] <mailto:[email-masked]>
> https://www.ietf.org/mailman/listinfo/lime <https://www.ietf.org/mailman/listinfo/lime>
Mahesh Jethanandani
[email-masked]

---

From: Qin Wu <[email-masked]>
Date: Mon, 3 Aug 2015 07:28:25 +0000

Talking with Lada, it seems this is PYANG UML tool bug.

-Qin
发件人: Mahesh Jethanandani [mailto:[email-masked]]
发送时间: 2015年8月3日 12:40
收件人: Andy Bierman
抄送: [email-masked]; YANG Doctors; Qin Wu
主题: Re: [Lime] reference a leaf instance that is not index or key of the list

On Aug 2, 2015, at 5:50 PM, Qin Wu <[email-masked]<mailto:[email-masked]>> wrote:

FYI.

Hi,

Andy

-Qin

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

Mahesh Jethanandani
[email-masked]<mailto:[email-masked]>

---

From: Qin Wu <[email-masked]>
Date: Mon, 3 Aug 2015 07:29:10 +0000

Sure, I will add.

-Qin
-----邮件原件-----
发件人: Ladislav Lhotka [mailto:[email-masked]] 
发送时间: 2015年8月3日 14:29
收件人: Mahesh Jethanandani
抄送: Andy Bierman; YANG Doctors; [email-masked]; Qin Wu
主题: Re: [yang-doctors] [Lime] reference a leaf instance that is not index or key of the list

Qin,

could you create a new pyang issue for the problem you encountered? Also please attach (or include link to) the exact version of the module with which it happens.

https://github.com/mbj4668/pyang/issues

Thanks, Lada

> On 03 Aug 2015, at 06:39, Mahesh Jethanandani <[email-masked]> wrote:
> 
>> On Fri, Jul 31, 2015 at 1:34 AM, Qin Wu <[email-masked]> wrote:
>> Hi, Andy:
>> e.g., In draft-tissa-lime-yang-oam-model-05, the snippset of 
>> "admin-status" is defined as follows "
>>     leaf admin-status {
>>       type leafref {
>> > 发件人: Lime [mailto:[email-masked]] 代表 Qin Wu
>> > 发送时间: 2015年6月1日 21:03
>> > 收件人: [email-masked]
>> > 主题: [Lime] reference a leaf instance that is not index or key of 
>> > the list
>> >
>> > Hi, All:
>> [email-masked]
> yang-doctors mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/yang-doctors

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

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 3 Aug 2015 08:28:41 +0200

Qin,

Thanks, Lada