diff options
author | Jiahao Li <reg@ljh.me> | 2024-11-17 14:17:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-17 19:17:00 +0000 |
commit | 081729eb8c9d6084916937a3095a6c0b2ba97144 (patch) | |
tree | f6ce5bc1a3179df57ef6c3203c97052b7ba2a196 | |
parent | aea62e7ff16ff4b1b1a5a04cfbd5b4750b6629ea (diff) | |
download | vyos.vyos-081729eb8c9d6084916937a3095a6c0b2ba97144.tar.gz vyos.vyos-081729eb8c9d6084916937a3095a6c0b2ba97144.zip |
Fix change detection for recent Vyos versions (#355)
* Fix change detection for recent Vyos versions
* Fix PEP8 styling
* Add changelogs fragment
-rw-r--r-- | changelogs/fragments/fix-recent-vyos-version-change-detection.yml | 3 | ||||
-rw-r--r-- | plugins/modules/vyos_config.py | 5 |
2 files changed, 7 insertions, 1 deletions
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 |