Skip to content

Commit

Permalink
Merge pull request #24 from ktbyers/fix_commit_exit
Browse files Browse the repository at this point in the history
Exit config mode at the end of commit
  • Loading branch information
ktbyers authored Sep 15, 2021
2 parents beaa785 + 90d04a1 commit 1c56157
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nornir_netmiko/tasks/netmiko_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ def netmiko_commit(task: Task, **kwargs: Any) -> Result:
"""
conn = task.host.get_connection(CONNECTION_NAME, task.nornir.config)
result = conn.commit(**kwargs)

if conn.check_config_mode():
conn.exit_config_mode()
return Result(host=task.host, result=result, changed=True)

0 comments on commit 1c56157

Please sign in to comment.