infamy: restconf: Add support to delete individual entries in leaf-lists

This commit is contained in:
Mattias Walström
2024-12-19 14:42:17 +01:00
parent 79bec6877c
commit da260fabf9
+1 -1
View File
@@ -33,7 +33,7 @@ def xpath_to_uri(xpath, extra=None):
if matches:
for key, value in matches:
# replace [key=value] with =value
uri_path = re.sub(rf'\[{key}=["\']{value}["\']\]', f'={value}', xpath)
uri_path = re.sub(rf'\[{re.escape(key)}=["\']{re.escape(value)}["\']\]', f'={value}', xpath)
else:
uri_path = xpath