MartijnBraam / python-isc-dhcp-leases

Small python module for reading /var/lib/dhcp/dhcpd.leases from isc-dhcp-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add cltt, atsfp, tsfp and tstp as date formatted properties

jjakob opened this issue · comments

There is a way to get these from data{} but unformatted, as-is in leases file.
start and end get formatted with parse_time so these four should be also. Otherwise we'd need to duplicate the parse_time in our script.

That sounds like a good improvement. I'll look into it

Also worth documenting that the times are in UTC regardless of the system timezone and the datatime objects are naive (have no timezone data). It would maybe be useful to make these aware.

It wouldn't simplify things much as to conversion to local time but might be more correct.

https://github.com/vyos/vyos-1x/blob/9ff4f0c9f7cc75168b116de3a7d7adecbcc3bde1/src/op_mode/show_dhcpv6.py#L71

https://github.com/vyos/vyos-1x/blob/9ff4f0c9f7cc75168b116de3a7d7adecbcc3bde1/src/op_mode/show_dhcpv6.py#L64