diff options
| author | l0crian1 <ryan.claridge13@gmail.com> | 2025-11-04 11:25:42 -0500 |
|---|---|---|
| committer | l0crian1 <ryan.claridge13@gmail.com> | 2025-11-04 11:25:42 -0500 |
| commit | 354517677fb9eceb82e478f33a7c481c469b248a (patch) | |
| tree | 57dbc971f3b41295a3522749ea9a09c6111488b7 /python | |
| parent | 559dd60a3bdb5866eb81c332d594a8b91529c4a4 (diff) | |
| download | vyos-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.py | 10 |
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 |
