Skip to content

Commit

Permalink
- Add support to pass a commit comment to the underlying netmiko ssh …
Browse files Browse the repository at this point in the history
…device.

- Update requirements.txt to require a more recent version of netmiko (3.3.2 supports passing a commit comment).
  • Loading branch information
hkam40k committed Dec 18, 2020
1 parent 06e404f commit e6fa272
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions napalm_panos/panos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e6fa272

Please sign in to comment.