Tool crashes on lease entries that lack ends and/or starts
Crashes on lease files from failover peers that contain entries like this:
lease 178.16.2.1 {
binding state free;
}
The code dies because there is no value for ends or starts.
tmark@cserver dhcp2kea (main) $ ./runit.sh "ends=0" "starts=0" -d /home/tmark/labs/var/isc_dhcp/tip/output/fo_secondary.leases
Traceback (most recent call last):
File "./dhcp2kea.py", line 317, in <module>
print(leases,file=f) # writing
File "./dhcp2kea.py", line 86, in __str__
max_life = (self.ver==4) and (v["ends"]-v["starts"]) or v["max-life"]
TypeError: unsupported operand type(s) for -: 'str' and 'str'
In reality it should simply discard all leases with binding state == free.
I've attached the lease file: