Closed colinjc closed 7 years ago
LGTM.
Out of curiousity how did you produce that lease? Static lease?
One more thing: Do you mind adding that kind of case to the tests?
@andir Honestly, I'm not sure how the lease was produced since I had nothing to do with the configuration of the server. I assume that you're right and it is a static lease though judging from the age.
I can quickly add a test, but I'm not sure where to add them. Should I add a record to the debian7 file and put the test in test_iscDhcpLeases.py?
Thanks for the contribution.
The test code should go in test_iscDhcpLeases.py and the record should go in a seperate file in the test_files directory (the same as the unittest for the options)
Looks great, thanks!
When parsing our dhcpd.leases file the library was crashing on a record because it has the hardware field but not he ends field, so it tries to construct and fails with a KeyError here
lease 172.23.251.150 { starts 4 2015/09/10 00:29:00; tstp 4 2015/09/10 00:28:44; tsfp 4 2015/09/10 00:29:00; atsfp 4 2015/09/10 00:29:00; binding state free; hardware ethernet 00:21:cc:06:94:e9; uid "\001\000!\314\006\224\351"; }