diff --git a/nornir_netmiko/tasks/netmiko_commit.py b/nornir_netmiko/tasks/netmiko_commit.py index 7f6555d..e5e071a 100644 --- a/nornir_netmiko/tasks/netmiko_commit.py +++ b/nornir_netmiko/tasks/netmiko_commit.py @@ -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)