diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-06-04 21:50:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-04 21:50:13 +0200 |
| commit | 5ca799ae86e46ae3f482d698acf9a340d312f644 (patch) | |
| tree | 9a799e7c400f5299bff7a09e3850ce71287190ec /src | |
| parent | 82fed020081cc0dde052594639aaf68e105865c6 (diff) | |
| parent | b5798692e8796d1682143046eaee2fc684f11e92 (diff) | |
| download | vyos-1x-5ca799ae86e46ae3f482d698acf9a340d312f644.tar.gz vyos-1x-5ca799ae86e46ae3f482d698acf9a340d312f644.zip | |
Merge pull request #5227 from indrajitr/dhcp-lease-time-fix
dhcp: T8933: Honor system timezone for timestamp display in op mode
Diffstat (limited to 'src')
| -rwxr-xr-x | src/op_mode/dhcp.py | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/op_mode/dhcp.py b/src/op_mode/dhcp.py index 9cb5a84ae..1f8d85823 100755 --- a/src/op_mode/dhcp.py +++ b/src/op_mode/dhcp.py @@ -19,7 +19,6 @@ import sys import typing from datetime import datetime -from datetime import timezone from glob import glob from ipaddress import ip_address from tabulate import tabulate @@ -105,12 +104,8 @@ def _get_formatted_server_leases(raw_data, family='inet'): ipaddr = lease.get('ip') hw_addr = lease.get('mac') state = lease.get('state') - start = datetime.fromtimestamp(lease.get('start'), timezone.utc) - end = ( - datetime.fromtimestamp(lease.get('end'), timezone.utc) - if lease.get('end') - else '-' - ) + start = datetime.fromtimestamp(lease.get('start')) + end = datetime.fromtimestamp(lease.get('end')) if lease.get('end') else '-' remain = lease.get('remaining') pool = lease.get('pool') hostname = lease.get('hostname') @@ -136,14 +131,8 @@ def _get_formatted_server_leases(raw_data, family='inet'): ipaddr = lease.get('ip') hw_addr = lease.get('mac') state = lease.get('state') - start = datetime.fromtimestamp( - lease.get('last_communication'), timezone.utc - ) - end = ( - datetime.fromtimestamp(lease.get('end'), timezone.utc) - if lease.get('end') - else '-' - ) + start = datetime.fromtimestamp(lease.get('last_communication')) + end = datetime.fromtimestamp(lease.get('end')) if lease.get('end') else '-' remain = lease.get('remaining') lease_type = lease.get('type') pool = lease.get('pool') |
