From 719f5396dfed3e74b75e7e9c0f4fae72359dba62 Mon Sep 17 00:00:00 2001 From: dineshbaburam91 Date: Fri, 18 Oct 2024 15:18:56 +0530 Subject: [PATCH] Fixed error handling on HelloHandler --- lib/jnpr/junos/transport/tty_netconf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/jnpr/junos/transport/tty_netconf.py b/lib/jnpr/junos/transport/tty_netconf.py index 1d5133de4..593c9b9f9 100644 --- a/lib/jnpr/junos/transport/tty_netconf.py +++ b/lib/jnpr/junos/transport/tty_netconf.py @@ -68,7 +68,9 @@ def open(self, at_shell): raise RuntimeError("Error: netconf not responding") self.hello = self._receive() - self._session_id, _ = HelloHandler.parse(self.hello.decode("utf-8")) + self._session_id, _ = HelloHandler.parse( + self.hello.decode("utf-8") if isinstance(self.hello, bytes) else self.hello + ) def close(self, force=False): """issue the XML API to close the session"""