From e6fa272420264a5657ad1d509ea33ffc817a135e Mon Sep 17 00:00:00 2001 From: Hannu Kamarainen Date: Fri, 18 Dec 2020 15:31:19 +0100 Subject: [PATCH] - Add support to pass a commit comment to the underlying netmiko ssh device. - Update requirements.txt to require a more recent version of netmiko (3.3.2 supports passing a commit comment). --- napalm_panos/panos.py | 8 ++------ requirements.txt | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/napalm_panos/panos.py b/napalm_panos/panos.py index 844d58c..acb0669 100644 --- a/napalm_panos/panos.py +++ b/napalm_panos/panos.py @@ -311,20 +311,16 @@ def _save_backup(self): else: return False - def commit_config(self, message=""): + def commit_config(self, message=None): """ Netmiko is being used to commit the configuration because it takes a better care of results compared to pan-python. """ - if message: - raise NotImplementedError( - "Commit message not implemented for this platform" - ) if self.loaded: if self.ssh_connection is False: self._open_ssh() try: - self.ssh_device.commit() + self.ssh_device.commit(comment=message) time.sleep(3) self.loaded = False self.changed = True diff --git a/requirements.txt b/requirements.txt index fba356b..7197d93 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ napalm>=2.3.0 lxml==4.3.5 pan-python -netmiko>=1.0.0 +netmiko>=3.3.2 requests-toolbelt xmltodict future