From 081729eb8c9d6084916937a3095a6c0b2ba97144 Mon Sep 17 00:00:00 2001 From: Jiahao Li Date: Sun, 17 Nov 2024 14:17:00 -0500 Subject: Fix change detection for recent Vyos versions (#355) * Fix change detection for recent Vyos versions * Fix PEP8 styling * Add changelogs fragment --- changelogs/fragments/fix-recent-vyos-version-change-detection.yml | 3 +++ plugins/modules/vyos_config.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/fix-recent-vyos-version-change-detection.yml diff --git a/changelogs/fragments/fix-recent-vyos-version-change-detection.yml b/changelogs/fragments/fix-recent-vyos-version-change-detection.yml new file mode 100644 index 00000000..f2dfe73a --- /dev/null +++ b/changelogs/fragments/fix-recent-vyos-version-change-detection.yml @@ -0,0 +1,3 @@ +--- +trivial: + - Fix change detection for recent Vyos versions diff --git a/plugins/modules/vyos_config.py b/plugins/modules/vyos_config.py index bf5d4217..60be02c8 100644 --- a/plugins/modules/vyos_config.py +++ b/plugins/modules/vyos_config.py @@ -358,7 +358,10 @@ def main(): if module.params["save"]: diff = run_commands(module, commands=["configure", "compare saved"])[1] - if diff != "[edit]": + if diff not in { + "[edit]", + "No changes between working and saved configurations.\n\n[edit]" + }: if not module.check_mode: run_commands(module, commands=["save"]) result["changed"] = True -- cgit v1.2.3