From ed6881a1abae979704055ffbac4ef2ea0b633799 Mon Sep 17 00:00:00 2001 From: Charlie Allom Date: Thu, 5 Dec 2019 21:34:36 +0000 Subject: [PATCH] add cli() You could really shoot yourself in the foot with this. --- README.md | 2 +- napalm_opengear/opengear.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9eed963..243d54a 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,11 @@ Editing the XML or diffing the XML is not supported, this may limit the amount o * rollback * load_merge_candidate * get_users +* cli ### Missing APIs. -* cli * compliance_report * connection_tests * get_bgp_config diff --git a/napalm_opengear/opengear.py b/napalm_opengear/opengear.py index fe21f58..2352c3b 100644 --- a/napalm_opengear/opengear.py +++ b/napalm_opengear/opengear.py @@ -45,6 +45,13 @@ def _send_command(self, command): except (socket.error, EOFError) as e: raise ConnectionException(str(e)) + def cli(self, cmd): + """send some commands via sudo.""" + output = self._send_command('sudo {0}'.format(cmd.strip())) + + return output + + def open(self): """Open a connection to the device.""" self.device = self._netmiko_open(