From 91e94036bf808d36399b698fbcecf4b9836f5806 Mon Sep 17 00:00:00 2001
From: John Estabrook <jestabro@vyos.io>
Date: Sun, 9 Jul 2023 17:49:41 -0500
Subject: xml: T5345: remove unneeded, incorrect check on paths

This check can raise a false positive exception in the case of a
tag-node value name equal to the tag-node name; it is unneeded in any
case as the functions are called with well-defined paths, respectively,
with a correct verification.
---
 python/vyos/xml_ref/definition.py | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/python/vyos/xml_ref/definition.py b/python/vyos/xml_ref/definition.py
index 33a49ca69..7634773d6 100644
--- a/python/vyos/xml_ref/definition.py
+++ b/python/vyos/xml_ref/definition.py
@@ -123,9 +123,6 @@ class Xml:
         return d
 
     def multi_to_list(self, rpath: list, conf: dict) -> dict:
-        if rpath and rpath[-1] in list(conf):
-            raise ValueError('rpath should be disjoint from conf keys')
-
         res: Any = {}
 
         for k in list(conf):
@@ -246,10 +243,6 @@ class Xml:
         if not conf:
             return self.get_defaults(path, get_first_key=get_first_key,
                                      recursive=recursive)
-        if path and path[-1] in list(conf):
-            conf = conf[path[-1]]
-            conf = {} if not isinstance(conf, dict) else conf
-
         if not self._well_defined(path, conf):
             print('path to config dict does not define full config paths')
             return {}
-- 
cgit v1.2.3