From e38e68a388285f3240db0843b7b7acfe68349957 Mon Sep 17 00:00:00 2001 From: Dylan Kaplan Date: Tue, 23 Jul 2024 11:48:52 -0700 Subject: [PATCH 1/2] Get full RPC response in cli fucntion --- lib/jnpr/junos/device.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/jnpr/junos/device.py b/lib/jnpr/junos/device.py index 641806803..9f4c6d283 100644 --- a/lib/jnpr/junos/device.py +++ b/lib/jnpr/junos/device.py @@ -735,6 +735,8 @@ def cli(self, command, format="text", warning=True): if rsp is True: return "" if rsp.tag in ["output", "rpc-reply"]: + if rsp.tag == "output" and rsp.getparent(): + rsp = rsp.getparent() encode = None if sys.version < "3" else "unicode" return etree.tostring( rsp, method="text", with_tail=False, encoding=encode From 1c40c2d6cb64bf80bf5a6f68c7eabd7c3abbee41 Mon Sep 17 00:00:00 2001 From: Dylan Kaplan Date: Wed, 31 Jul 2024 10:05:41 -0700 Subject: [PATCH 2/2] Update parent check --- lib/jnpr/junos/device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jnpr/junos/device.py b/lib/jnpr/junos/device.py index 9f4c6d283..f7bcd9c6c 100644 --- a/lib/jnpr/junos/device.py +++ b/lib/jnpr/junos/device.py @@ -735,7 +735,7 @@ def cli(self, command, format="text", warning=True): if rsp is True: return "" if rsp.tag in ["output", "rpc-reply"]: - if rsp.tag == "output" and rsp.getparent(): + if rsp.tag == "output" and rsp.getparent() is not None: rsp = rsp.getparent() encode = None if sys.version < "3" else "unicode" return etree.tostring(