Skip to content

Commit 6c19400

Browse files
committed
statd: fix double timezone in DHCP lease expiry timestamps
The isoformat() method already includes the timezone offset when the datetime object has timezone info. Appending "+00:00" created an invalid double-timezone suffix like "2025-11-30T13:13:49+00:00+00:00" which failed YANG validation. Error was: admin@bpi-26-60-00:/> show dhcp-server Error running sysrepocfg: Command '['sysrepocfg', '-f', 'json', '-X', '-d', 'operational', '-x', '/infix-dhcp-server:dhcp-server']' returned non-zero exit status 1. No interface data retrieved. With syslog showing: statd[4291]: libyang[0]: Invalid union value "2025-11-30T13:13:49+00:00+00:00" - no matching subtype found Signed-off-by: Joachim Wiberg <[email protected]>
1 parent 58e1238 commit 6c19400

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/statd/python/yanger/infix_dhcp_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def leases(leases_file):
2323
else:
2424
dt = datetime.fromtimestamp(int(tokens[0]),
2525
tz=timezone.utc)
26-
expires = dt.isoformat() + "+00:00"
26+
expires = dt.isoformat()
2727

2828
row = {
2929
"expires": expires,

0 commit comments

Comments
 (0)