mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-30 12:33:02 +02:00
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 <troglobit@gmail.com>
This commit is contained in:
@@ -23,7 +23,7 @@ def leases(leases_file):
|
||||
else:
|
||||
dt = datetime.fromtimestamp(int(tokens[0]),
|
||||
tz=timezone.utc)
|
||||
expires = dt.isoformat() + "+00:00"
|
||||
expires = dt.isoformat()
|
||||
|
||||
row = {
|
||||
"expires": expires,
|
||||
|
||||
Reference in New Issue
Block a user