Skip to content

Commit bd42d3c

Browse files
committed
Path handling fixes for NX/XR
1 parent bd877d4 commit bd42d3c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/cisco_gnmi/nx.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ def parse_xpath_to_gnmi_path(self, xpath, origin=None):
157157
"OpenConfig data models not yet supported on NX-OS!"
158158
)
159159
if origin is None:
160-
if any(map(xpath.startswith, ["Cisco-NX-OS-device", "ietf-interfaces"])):
160+
if any(
161+
map(xpath.startswith, ["Cisco-NX-OS-device", "/Cisco-NX-OS-device"])
162+
):
161163
origin = "device"
162164
# Remove the module
163165
xpath = xpath.split(":", 1)[1]

src/cisco_gnmi/xr.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ def parse_xpath_to_gnmi_path(self, xpath, origin=None):
346346
else:
347347
# module name
348348
origin, xpath = xpath.split(":", 1)
349+
origin = origin.strip("/")
349350
return super(XRClient, self).parse_xpath_to_gnmi_path(xpath, origin)
350351

351352
def parse_cli_to_gnmi_path(self, command):

0 commit comments

Comments
 (0)