12-06-2018 04:39 PM
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 ?
Solved! Go to Solution.
12-07-2018 12:45 AM
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 ../ ?
12-07-2018 12:45 AM
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 ../ ?
12-09-2018 09:11 AM
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 ?
12-11-2018 05:38 PM
This has been solved. Pyang was reporting error but there was no issue with the compilation.
Thanks !!!
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: