Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sonic-yang-mgmt]: Fixing issues caused by conflict resolution. #82

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sonic-yang-mgmt/_sonic_yang_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def delete_node(self, xpath):
leaf = ly.Schema_Node_Leaf(snode)
if leaf.is_key():
# try to delete parent
nodeP = self.find_parent_node(xpath)
nodeP = self.find_parent_data_node(xpath)
xpathP = nodeP.path()
if self._delete_node(xpath=xpathP, node=nodeP) == False:
raise Exception('_delete_node failed')
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-yang-mgmt/sonic_yang.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def find_data_node_schema_xpath(self, data_xpath):
"""
def add_data_node(self, data_xpath, value):
try:
self.new_node(xpath, value)
self.new_data_node(data_xpath, value)
#check if the node added to the data tree
self.find_data_node(data_xpath)
except Exception as e:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_add_node(self, data, yang_s):
for node in data['new_nodes']:
xpath = str(node['xpath'])
value = node['value']
yang_s.add_node(xpath, str(value))
yang_s.add_data_node(xpath, str(value))

data_node = yang_s.find_data_node(xpath)
assert data_node is not None
Expand Down