Closed ghost closed 7 years ago
Well it should ignore incomplete leases since those aren't valid. I'll check why your backup lease won't work.
So in fact, this lease does not appear in the list of leases.get() because it lacks the "ends" ?
Oh I thought you meant end as in "missing the }
". Leases without end should work.
I've added testcases for both your leases and it seems to work fine. You can see my lease file here: https://github.com/MartijnBraam/python-isc-dhcp-leases/pull/21/files
Maybe you have something different in your lease file that makes it stop working?
In fact, as the lease is backup it has never been used, there is not the line "hardware ethernet ***" and I think the problem is there
It would be necessary that the code accepts that the lease does not have ends and harware
The current version does support leases without ends but skips leases without hardware. In #21 I've added a option to the get() method to allow you to get hardware-less leases.
Can you try if that version works if you specify get(include_backups=True)
?
Thank you ! It works very well in case there is no hardware but I still have the following error if I do not have any ends
line 209, in __init__
if properties['ends'] == 'never':
KeyError: 'ends'
Hmm that line doesn't exist in the current codebase. Are you using an older version?
This corresponded to line 213 in the most recent version. I missed get('ends', 'never'), it's works now !
I've just released 0.9.0 on pypi with the fixes for this included.
Hello,
My problem is the following: I can't extract from the leases.get (), the leases whose binding state is backup and of which there is no end.
I can :
I can"t :
Is there a solution ?
Regards,