Skip to content

Commit

Permalink
[sonic-yang-mgmt]: Fixing issues caused by conflict resolution. (soni…
Browse files Browse the repository at this point in the history
…c-net#82)

Signed-off-by: Praveen Chaudhary [email protected]
  • Loading branch information
Praveen Chaudhary authored Jun 30, 2020
1 parent 7d0f2e5 commit 19c6467
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
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

0 comments on commit 19c6467

Please sign in to comment.