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

Show static leases (PR welcome?) #41

Open boretom opened 8 months ago

boretom commented 8 months ago

Hi,

I got into VyOS and versions < 1.5 use this module to get the DHCP leases, well all except the static one since they are in the dhcp.conf file.

Would there be an interest to list the static leases to in this module? And maybe accepting a PR if someone (me :) ) would create one?

Or is it out of the scope/interest of this module?

Have a great day Thomas

MartijnBraam commented 7 months ago

Oh that's an interesting usecase I haven't thought of. I think it makes sense to have support for reading those from this module but I don't think it should be integrated in the dhcp.leases parser.

I think a seperate class that can parse the static leases from the config file (and maybe more in the future) would make sense so the behavior of the current class stays the same and the static leases contain different information than the information stored in the leases file and there's some wildcard possibilities from scanning the specs for this quickly.

boretom commented 7 months ago

In another modules of course, as you correctly stated there are different information associated with the static leases. Something like dhcp.leases_static (I'm not that much of a progammer, have to check what the naming conventions are).

Let's me think about it :) ... but good to know that you would be open to add that functionality.