From fda349e17f5cba3ef7ca515e0ed4b5af0c925588 Mon Sep 17 00:00:00 2001 From: Petr Klima Date: Tue, 23 Apr 2024 14:55:59 +0200 Subject: [PATCH] Add netmico command timeout --- napalm_s350/s350.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/napalm_s350/s350.py b/napalm_s350/s350.py index 59d9f3b..b25db96 100644 --- a/napalm_s350/s350.py +++ b/napalm_s350/s350.py @@ -100,11 +100,17 @@ def _send_command(self, command): try: if isinstance(command, list): for cmd in command: - output = self.device.send_command(cmd) + output = self.device.send_command( + cmd, + read_timeout=self.timeout + ) if "% Invalid" not in output: break else: - output = self.device.send_command(command) + output = self.device.send_command( + command, + read_timeout=self.timeout + ) return output.strip() except (socket.error, EOFError) as e: raise ConnectionClosedException(str(e))