From 82813eb26e5482716d1bd92f49c3b81ea58f90cb Mon Sep 17 00:00:00 2001 From: laherre Date: Fri, 20 Nov 2020 13:05:04 +0100 Subject: [PATCH 1/2] driver force_no_enable option --- napalm_s350/s350.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/napalm_s350/s350.py b/napalm_s350/s350.py index 44751a5..e74f460 100644 --- a/napalm_s350/s350.py +++ b/napalm_s350/s350.py @@ -79,6 +79,7 @@ class S350Driver(NetworkDriver): self.port = optional_args.get('port', 22) self.device = None + self.force_no_enable = optional_args.get("force_no_enable", False) def open(self): """Open a connection to the device.""" @@ -87,7 +88,8 @@ class S350Driver(NetworkDriver): username=self.username, password=self.password, **self.netmiko_optional_args) - self.device.enable() + if not self.force_no_enable: + self.device.enable() def _discover_file_system(self): try: From 2ab5bd8b1614bb114cbc70a990e11378bb10215e Mon Sep 17 00:00:00 2001 From: laherre Date: Fri, 20 Nov 2020 13:28:51 +0100 Subject: [PATCH 2/2] CLI test with force_no_enable --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8dbd3c7..e1bcc7c 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ pip3 install napalm_s350 Default information (the same as `call get_facts` ```bash napalm --user USER --password PASSWORD --vendor s350 HOSTNAME + +napalm --user USER --password PASSWORD --vendor s350 HOSTNAME --optional_args "force_no_enable=True" ``` Get interfaces