diff options
author | Daniil Baturin <daniil@vyos.io> | 2025-07-09 20:19:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-09 20:19:07 +0100 |
commit | 483023e846c8aebfaebaa7293f03917095708fcd (patch) | |
tree | f8ee97c17fb24a98aeccff8f10f7cdc9b4077f5f /src | |
parent | 362ceee301c84327694b7c4bc0de8984f431d4f2 (diff) | |
parent | 6b1a5d4f844f0ede09b1e4823e0f0620476fdcd9 (diff) | |
download | vyos-1x-483023e846c8aebfaebaa7293f03917095708fcd.tar.gz vyos-1x-483023e846c8aebfaebaa7293f03917095708fcd.zip |
Merge pull request #4596 from dmbaturin/T7622-fix-show-wan-load-balance
wlb: T7622: fix the op mode "run show wan-load-balance" command
Diffstat (limited to 'src')
-rwxr-xr-x | src/op_mode/load-balancing_wan.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/op_mode/load-balancing_wan.py b/src/op_mode/load-balancing_wan.py index cac13ca12..6f1d00dcd 100755 --- a/src/op_mode/load-balancing_wan.py +++ b/src/op_mode/load-balancing_wan.py @@ -56,13 +56,15 @@ def _get_raw_data(): return data def _get_formatted_output(raw_data): + from time import time + for ifname, if_data in raw_data.items(): latest_change = if_data['last_success'] if if_data['last_success'] > if_data['last_failure'] else if_data['last_failure'] change_dt = datetime.fromtimestamp(latest_change) if latest_change > 0 else None success_dt = datetime.fromtimestamp(if_data['last_success']) if if_data['last_success'] > 0 else None failure_dt = datetime.fromtimestamp(if_data['last_failure']) if if_data['last_failure'] > 0 else None - now = datetime.fromtimestamp(time.time()) + now = datetime.fromtimestamp(time()) fmt_data = { 'ifname': ifname, |