summaryrefslogtreecommitdiff
path: root/plugins/module_utils/network
diff options
context:
space:
mode:
authoromnom62 <75066712+omnom62@users.noreply.github.com>2025-05-23 17:01:24 +1000
committerGitHub <noreply@github.com>2025-05-23 03:01:24 -0400
commit2879b9a4193aa3153f05b985e1f12d78cfbe6fd0 (patch)
tree02e4ef1a77cb051d8c38010fe2e41b129a3e3055 /plugins/module_utils/network
parentcd2f41d34ff22ea7719348ec18a30f1c499b72c8 (diff)
downloadvyos.vyos-2879b9a4193aa3153f05b985e1f12d78cfbe6fd0.tar.gz
vyos.vyos-2879b9a4193aa3153f05b985e1f12d78cfbe6fd0.zip
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 <johndoe@email.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Diffstat (limited to 'plugins/module_utils/network')
-rw-r--r--plugins/module_utils/network/vyos/vyos.py8
1 files changed, 6 insertions, 2 deletions
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)