-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lease6 iaid duid properties #4
Lease6 iaid duid properties #4
Conversation
@@ -160,6 +162,9 @@ def __init__(self, ip, data, cltt, host_identifier, address_type): | |||
self.last_communication = cltt | |||
|
|||
self.host_identifier = codecs.decode(host_identifier, "unicode_escape") | |||
host_identifier_bytes = self.host_identifier.encode('latin-1') | |||
self.iaid = int.from_bytes(host_identifier_bytes[0:4], byteorder='little') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks compatibility with python 2.7 since this function is python 3 specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be fixed now
019240f
to
81ae7c3
Compare
This is a great functionallity to have but there is no test case added. I also added some comments in the code |
81ae7c3
to
cdb03a2
Compare
python 2.7 compatibility has been restored and test cases have been updated |
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 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 |
add iaid and duid properties to the Lease6 object (extracted from the host_identifier)