Skip to content

Commit

Permalink
Add netmico command timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
qaxi committed Apr 23, 2024
1 parent d74cfb9 commit fda349e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions napalm_s350/s350.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit fda349e

Please sign in to comment.