MartijnBraam / python-isc-dhcp-leases

Small python module for reading /var/lib/dhcp/dhcpd.leases from isc-dhcp-server
MIT License
123 stars 47 forks source link

relax parsing rules to accept openbsd's dhcpd.leases format #29

Open rstms opened 5 years ago

rstms commented 5 years ago

I made these changes because I needed this to run on my OpenBSD 6.4 system, which uses a dhcpd that is derived from isc-dhcpd. The dhcpd.leases file has minor differences which required changes to the parser. The existing tests all still pass.

These changes allow the module to read the OpenBSD lease file:

ignore 'UTC' suffix on time fields record with missing binding_state defaults to 'active' interpret 'abandoned;' field as 'binding_state abandoned;" added test case for openbsd dhcpd.leases added Makefile for make test

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-23.0%) to 77.039% when pulling 7fc81df18be7441769f2abf59fd554a9295b1d61 on rstms:master into e96c00e31f3a52c01ef98193577d614d08a93285 on MartijnBraam:master.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-23.0%) to 77.039% when pulling 7fc81df18be7441769f2abf59fd554a9295b1d61 on rstms:master into e96c00e31f3a52c01ef98193577d614d08a93285 on MartijnBraam:master.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-23.0%) to 77.039% when pulling 7fc81df18be7441769f2abf59fd554a9295b1d61 on rstms:master into e96c00e31f3a52c01ef98193577d614d08a93285 on MartijnBraam:master.

MartijnBraam commented 5 years ago

Thanks for the PR!, the code looks good but the unit test is broken because you've added a method to the test case with the same name as another method, so most tests don't run currently.

raspbeguy commented 3 years ago

Hello, Sorry for necrobumping this PR, but I really wish it to be merged. @rstms Is this a problem to fix the unit tests?