summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorIndrajit Raychaudhuri <irc@indrajit.com>2026-04-13 22:55:13 -0500
committerIndrajit Raychaudhuri <irc@indrajit.com>2026-04-14 10:21:33 -0500
commit493e3bec1e708aa9328c17d7f5fc07bb66044b7d (patch)
tree599b6d214da4831a69113a9448e5baeb90e901e6 /python
parent96573c5c3fa4a619819e808c4f8e7a8996cf7fe6 (diff)
downloadvyos-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.py2
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 (