From 13236e56899e21d887afab3a037e70f5df4db44b Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Wed, 1 Apr 2020 17:44:11 +0200 Subject: [PATCH] edgeos: Always exit configure mode Previously, the configure mode was kept active when not committing the changes. This made later invocations of `show configuration commands` invalid (because that command must be executed outside of configure mode) which caused all later edgeos_config module invocations in check_mode to erroneously return a changed state. --- plugins/module_utils/network/edgeos/edgeos.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/module_utils/network/edgeos/edgeos.py b/plugins/module_utils/network/edgeos/edgeos.py index c7eef621790..f2a6392bb93 100644 --- a/plugins/module_utils/network/edgeos/edgeos.py +++ b/plugins/module_utils/network/edgeos/edgeos.py @@ -122,11 +122,10 @@ def load_config(module, commands, commit=False, comment=None): except ConnectionError: connection.discard_changes() module.fail_json(msg='commit failed: %s' % out) - - if not commit: - connection.discard_changes() else: - connection.get('exit') + connection.discard_changes() + + connection.get('exit') if diff: return diff