From 7ef13cf9472bcead47835b6b0cdf511659bedf80 Mon Sep 17 00:00:00 2001 From: Petr Klima Date: Mon, 8 Mar 2021 13:44:56 +0100 Subject: [PATCH] implementation of cli() method --- napalm_s350/s350.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/napalm_s350/s350.py b/napalm_s350/s350.py index ff6bbbe..f0b2210 100644 --- a/napalm_s350/s350.py +++ b/napalm_s350/s350.py @@ -111,6 +111,16 @@ class S350Driver(NetworkDriver): """Close the connection to the device.""" self.device.disconnect() + def cli(self, commands): + output = {} + try: + for cmd in commands: + output[cmd] = self.device.send_command(cmd) + + return output + except (socket.error, EOFError) as e: + raise ConnectionClosedException(str(e)) + def _send_command(self, command): """Wrapper for self.device.send.command().