MartijnBraam / python-isc-dhcp-leases

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

Lease6 iaid duid properties #4

Closed freddy36 closed 9 years ago

freddy36 commented 9 years ago

add iaid and duid properties to the Lease6 object (extracted from the host_identifier)

MartijnBraam commented 9 years ago

This is a great functionallity to have but there is no test case added. I also added some comments in the code

freddy36 commented 9 years ago

python 2.7 compatibility has been restored and test cases have been updated

MartijnBraam commented 9 years ago

The python2.7 tests are still failing. It seems my travis config is not fully correct since it reports the status of the coveralls upload but if you look at https://travis-ci.org/MartijnBraam/python-isc-dhcp-leases/jobs/79677899 you can see the errors. These are all unicode but i'm not completely sure how to fix that without breaking python3.2 compatability

Also from the dhcpd.leases documentation:

The IAID_DUID value is recorded as a colon-separated hexadecimal list or as a quoted string. If it is recorded as a quoted string and it contains one or more non-printable characters, those characters are represented as octal escapes - a backslash character followed by three octal digits.

The quoted variant used in the dhcpd6.leases test file are in octal and parsed as a escaped unicode string so the value is correct. Also the code doesn't account for the colon-separated variant but that's a problem for when I actually have a example file to test against