diff options
| author | Indrajit Raychaudhuri <irc@indrajit.com> | 2026-04-13 22:55:13 -0500 |
|---|---|---|
| committer | Indrajit Raychaudhuri <irc@indrajit.com> | 2026-04-14 10:21:33 -0500 |
| commit | 493e3bec1e708aa9328c17d7f5fc07bb66044b7d (patch) | |
| tree | 599b6d214da4831a69113a9448e5baeb90e901e6 /python | |
| parent | 96573c5c3fa4a619819e808c4f8e7a8996cf7fe6 (diff) | |
| download | vyos-1x-493e3bec1e708aa9328c17d7f5fc07bb66044b7d.tar.gz vyos-1x-493e3bec1e708aa9328c17d7f5fc07bb66044b7d.zip | |
dhcp: T8493: Fix sort ordering for remaining time display
Op mode command `show dhcp server leases sort remaining`
should sort leases by remaining time in timedelta form,
not string form.
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/kea.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/vyos/kea.py b/python/vyos/kea.py index 703dd8b49..2ebf1339a 100644 --- a/python/vyos/kea.py +++ b/python/vyos/kea.py @@ -661,7 +661,7 @@ def kea_get_server_leases(config, inet, vrf_name, pools=[], state=[], origin=Non if lease['valid-lft'] > 0 and lease['expire_time'] > now: # subtraction gives us a timedelta object which can't be formatted # with strftime so we use str(), split gets rid of the microseconds - data_lease['remaining'] = str(lease['expire_time'] - now).split('.')[0] + data_lease['remaining'] = (lease['expire_time'].replace(microsecond=0) - now.replace(microsecond=0)) # Do not add old leases if ( |
