Skip to content

Commit

Permalink
Merge pull request #1240 from tynany/develop
Browse files Browse the repository at this point in the history
fix: force_no_enable enabled on ios and nx only
  • Loading branch information
mirceaulinic authored Jul 13, 2020
2 parents 052ced8 + 57a5997 commit 6529ad1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions napalm/base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,14 @@ def _netmiko_open(self, device_type, netmiko_optional_args=None):
except NetMikoTimeoutException:
raise ConnectionException("Cannot connect to {}".format(self.hostname))

# ensure in enable mode if not force disable
if not self.force_no_enable:
# Disable enable mode if force_no_enable is true (for NAPALM drivers
# that support force_no_enable)
try:
if not self.force_no_enable:
self._netmiko_device.enable()
except AttributeError:
self._netmiko_device.enable()

return self._netmiko_device

def _netmiko_close(self):
Expand Down

0 comments on commit 6529ad1

Please sign in to comment.