From 2879b9a4193aa3153f05b985e1f12d78cfbe6fd0 Mon Sep 17 00:00:00 2001 From: omnom62 <75066712+omnom62@users.noreply.github.com> Date: Fri, 23 May 2025 17:01:24 +1000 Subject: Integration tests FDR (#416) * clean-up for strreamlines e2e integration tests * 1.4+ fix for snmp_server * changes to integratio tests * changelog fix * fix ampty json on vyos.py get_config * fix vyos get_config * quick fix for teardwon in vyos_system test * Update plugins/module_utils/network/vyos/vyos.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * copilot recommendations incorporated * remove copilot mess --------- Co-authored-by: John Doe Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- plugins/module_utils/network/vyos/vyos.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins/module_utils/network') diff --git a/plugins/module_utils/network/vyos/vyos.py b/plugins/module_utils/network/vyos/vyos.py index f37294e6..5c157818 100644 --- a/plugins/module_utils/network/vyos/vyos.py +++ b/plugins/module_utils/network/vyos/vyos.py @@ -68,8 +68,12 @@ def get_capabilities(module): def get_config(module, flags=None, format=None): flags = [] if flags is None else flags global _DEVICE_CONFIGS - - if _DEVICE_CONFIGS != {} or module.params["match"] == "none": + # If _DEVICE_CONFIGS is non-empty and module.params["match"] is "none", + # return the cached device configurations. This avoids redundant calls + # to the connection when no specific match criteria are provided. + if _DEVICE_CONFIGS != {} and ( + module.params["match"] is not None and module.params["match"] == "none" + ): return to_text(_DEVICE_CONFIGS) else: connection = get_connection(module) -- cgit v1.2.3