summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorl0crian1 <ryan.claridge13@gmail.com>2025-11-04 11:25:42 -0500
committerl0crian1 <ryan.claridge13@gmail.com>2025-11-04 11:25:42 -0500
commit354517677fb9eceb82e478f33a7c481c469b248a (patch)
tree57dbc971f3b41295a3522749ea9a09c6111488b7 /python
parent559dd60a3bdb5866eb81c332d594a8b91529c4a4 (diff)
downloadvyos-1x-354517677fb9eceb82e478f33a7c481c469b248a.tar.gz
vyos-1x-354517677fb9eceb82e478f33a7c481c469b248a.zip
wlb: T7977: Updated smoketest to validate nft vmap weight buckets
Diffstat (limited to 'python')
-rw-r--r--python/vyos/utils/misc.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/python/vyos/utils/misc.py b/python/vyos/utils/misc.py
index b8b25b860..20e3de746 100644
--- a/python/vyos/utils/misc.py
+++ b/python/vyos/utils/misc.py
@@ -68,7 +68,13 @@ def install_into_config(conf, config_paths, override_prompt=True):
if count > 0:
print(f'{count} value(s) installed. Use "compare" to see the pending changes, and "commit" to apply.')
-def wait_for(func: Callable[[], Any], interval: float = 1.0, timeout: float = 5.0) -> bool:
+def wait_for(
+ func: Callable[..., Any],
+ *args,
+ interval: float = 1.0,
+ timeout: float = 5.0,
+ **kwargs
+) -> bool:
"""
Repeatedly calls `func()` until it returns True or the timeout expires.
@@ -82,7 +88,7 @@ def wait_for(func: Callable[[], Any], interval: float = 1.0, timeout: float = 5.
"""
start = time.monotonic()
while True:
- if func():
+ if func(*args, **kwargs):
return True
if (time.monotonic() - start) >= timeout:
return False