From e5c977699cc53b3e3b4e001467d60f7d13b329a1 Mon Sep 17 00:00:00 2001 From: Johan Marcusson Date: Wed, 19 May 2021 15:14:21 +0200 Subject: [PATCH] Discard config if there was an error. This avoids stale config sessions lingering on the device. --- napalm/junos/junos.py | 1 + 1 file changed, 1 insertion(+) diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py index 5867fd90d..128749b0a 100644 --- a/napalm/junos/junos.py +++ b/napalm/junos/junos.py @@ -267,6 +267,7 @@ def _load_candidate(self, filename, config, overwrite): ignore_warning=self.ignore_warning, ) except ConfigLoadError as e: + self.discard_config() if self.config_replace: raise ReplaceConfigException(e.errs) else: