From 6441c31961c8b7c1c62d509a088dd50d5dae1a19 Mon Sep 17 00:00:00 2001 From: Simone Spinelli Date: Thu, 7 May 2020 19:04:15 +0200 Subject: [PATCH] Junos: close configuration in case configure_private is set to avoid configure session to stay forever. This is done in commit_config and discard_config functions. --- napalm/junos/junos.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py index 48cb81e3a..a8ce51b98 100644 --- a/napalm/junos/junos.py +++ b/napalm/junos/junos.py @@ -283,12 +283,16 @@ def commit_config(self, message=""): self.device.cu.commit(ignore_warning=self.ignore_warning, **commit_args) if not self.lock_disable and not self.session_config_lock: self._unlock() + if self.config_private: + self.device.rpc.close_configuration() def discard_config(self): """Discard changes (rollback 0).""" self.device.cu.rollback(rb_id=0) if not self.lock_disable and not self.session_config_lock: self._unlock() + if self.config_private: + self.device.rpc.close_configuration() def rollback(self): """Rollback to previous commit."""