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(