cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
851
Views
0
Helpful
3
Replies

deref() doesn't work

prmalik
Cisco Employee
Cisco Employee

Hi Team,

I have below error with the deref(). I also looked at Xpath and some old discussions but not able to figure out the issue.

 

      leaf sitename-existing {

        tailf:info "Unique Existing Site Name";

        description "This leaf for existing sitename. This is needed to pull site UUID ";

        type leafref {

        path "deref(../../device)/../ncs:config/vts-service:vts-service/vts-service:sites/vts-service:site/vts-service:id";            

        }

       }

 

Error :

vtsInstance-site-router.yang:41: error: vtsInstance-site-router:device in the path for sitename-existing at vtsInstance-site-router.yang:37 is not found

 

 

Below are details (Xpath for reference)

/devices/device[name='MPN-DEV0']/config/vts-service:vts-service/sites/site[id='be416d94-a2c2-41a4-b186-aec1739413ff']/name SITE3

 

Can you pls help me to understand what's wrong here ? 

1 Accepted Solution

Accepted Solutions

hniska
Cisco Employee
Cisco Employee

As the error message says, in your YANG module vtsInstance-site-router, two steps up from the deref(), no leaf named device can be found. So check the path, to many, to few ../ ? 

View solution in original post

3 Replies 3

hniska
Cisco Employee
Cisco Employee

As the error message says, in your YANG module vtsInstance-site-router, two steps up from the deref(), no leaf named device can be found. So check the path, to many, to few ../ ? 

Hi Hakan,

Thanks for your reply. I tried all combinations, after fixing device, I get below error :

error: vts-service:vts-service in the path for sitename-existing at vtsInstance-site-router.yang:45 is not found

 

for testing, I have configured as following :

(Below path is not working)

path "/ncs:devices/ncs:device[ncs:name=current()/../device]/ncs:config/vts-service:vts-service/vts-service:sites/vts-service:site/vts-service:id";

 

I have similar path working fine for XR (below path is working fine)

path "/ncs:devices/ncs:device[ncs:name=current()/../../device]/ncs:config/cisco-ios-xr:interface/cisco-ios-xr:GigabitEthernet/cisco-ios-xr:id";

 

I am still not sure issue with the vts-service as I see below xpath on NSO 

admin@ncs# show running-config devices device MPN-DEV0 config | display xpath
/devices/device[name='MPN-DEV0']/config/vts-service:vts-service/sites/site[id='be416d94-a2c2-41a4-b186-aec1739413ff']/name SITE3

 

Do you know why its complaining about  vts-service ? or something I have still wrong in the path ? 

 

 

prmalik
Cisco Employee
Cisco Employee

This has been solved. Pyang was reporting error but there was no issue with the compilation.

Thanks !!!