Skip to content

Commit

Permalink
Fixes type error when decoding invalid Netconf data
Browse files Browse the repository at this point in the history
Fixes issue Juniper#1254
  • Loading branch information
monnierj committed Aug 1, 2023
1 parent a106028 commit 3323350
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/jnpr/junos/transport/tty_netconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ def _parse_buffer(self, rxbuf):
if "</xnm:error>" in rxbuf:
for x in rxbuf:
if "<message>" in x:
return etree.XML(
return (
"<error-in-receive>" + x + "</error-in-receive>"
)
).encode("utf-8")
else:
return etree.XML("<error-in-receive/>")
return "<error-in-receive/>".encode("utf-8")

0 comments on commit 3323350

Please sign in to comment.