[sonic-yang] Backlinks are none when there is 0 backlinks (#8187)
Backlinks are none when there is 0 backlinks. without this change backlinks.number() throws an exception when backlinks==None.
This commit is contained in:
parent
604becdd5c
commit
62d3c245b8
@ -526,7 +526,7 @@ class SonicYang(SonicYangExtMixin):
|
||||
|
||||
schema_node = ly.Schema_Node_Leaf(data_node.schema())
|
||||
backlinks = schema_node.backlinks()
|
||||
if backlinks.number() > 0:
|
||||
if backlinks is not None and backlinks.number() > 0:
|
||||
for link in backlinks.schema():
|
||||
node_set = node.find_path(link.path())
|
||||
for data_set in node_set.data():
|
||||
|
@ -59,10 +59,12 @@
|
||||
|
||||
"dependencies":[
|
||||
{"xpath":"/test-port:port/PORT/PORT_LIST[port_name='Ethernet8']/port_name",
|
||||
"dependencies":
|
||||
["/test-acl:acl/ACL_TABLE/ACL_TABLE_LIST[ACL_TABLE_NAME='PACL-V6']/ports[.='Ethernet8']",
|
||||
"/test-interface:interface/INTERFACE/INTERFACE_LIST[interface='Ethernet8'][ip-prefix='10.1.1.64/26']/interface",
|
||||
"/test-interface:interface/INTERFACE/INTERFACE_LIST[interface='Ethernet8'][ip-prefix='2000:f500:40:a749::/126']/interface"]}
|
||||
"dependencies":
|
||||
["/test-acl:acl/ACL_TABLE/ACL_TABLE_LIST[ACL_TABLE_NAME='PACL-V6']/ports[.='Ethernet8']",
|
||||
"/test-interface:interface/INTERFACE/INTERFACE_LIST[interface='Ethernet8'][ip-prefix='10.1.1.64/26']/interface",
|
||||
"/test-interface:interface/INTERFACE/INTERFACE_LIST[interface='Ethernet8'][ip-prefix='2000:f500:40:a749::/126']/interface"]},
|
||||
{"xpath":"/test-port:port/PORT/PORT_LIST[port_name='Ethernet8']/alias",
|
||||
"dependencies":[]}
|
||||
],
|
||||
"schema_dependencies":[
|
||||
{"xpath":"/test-port:port/test-port:PORT/test-port:PORT_LIST/test-port:port_name",
|
||||
|
Reference in New Issue
Block a user