<div dir="ltr"><div>I managed to pull the script from the GIT repository.  It doesn't seem to be versioned, but I believe it is the latest and it says:</div><div><br></div><div># dhcp2kea by marmo<br># 6-12-2022 (dhcpd4), 14-12-2022 (dhcpd6), 15-12-2022 (dhcp2kea.php)<br># 23-12-2022 ("addr key=value" option)</div><div><br></div><div>It seems to work great on my "leases" file, EXCEPT for the entries that are abandoned, e.g.</div><div><font face="monospace">lease 192.168.1.43 {<br>        starts 0 2023/12/17 00:15:52 UTC;<br>        ends 2 2024/01/16 00:15:52 UTC;<br>        <br>        abandoned;<br>}</font></div><div><br></div><div>Then it says, </div><div><br></div><div><font face="monospace">root@remo:/home/john/xfer # python3 keama-leases.py dhcpd.leases<br>Traceback (most recent call last):<br>  File "/home/john/xfer/keama-leases.py", line 329, in <module><br>    print(leases,file=f)  # writing<br>    ^^^^^^^^^^^^^^^^^^^^<br>  File "/home/john/xfer/keama-leases.py", line 105, in __str__<br>    , v["hardware ethernet"] # hwaddr<br>      ~^^^^^^^^^^^^^^^^^^^^^<br>KeyError: 'hardware ethernet'</font></div><span class="gmail_signature_prefix"><div><span class="gmail_signature_prefix"><br></span></div><div><span class="gmail_signature_prefix">This is not a show stopper for me, because I can just edit out those half-dozen or so entries and then it seems to work fine (though I haven't tried importing the .csv file into a mem file - not that far yet - or maybe this IS the format of the mem file?) but since this is a perfectly legitimate entry from isc-dhcpd, I'm wondering if a fix might not be in order?  I'm guessing that it should be fairly simple to test for the existence of that key and skip the entry, but I'm not a python person (perl rules!) so I don't feel fully confident in trying to fix this.  If I' the best available candidate, I'm willing to take a run at it.</span></div><div><span class="gmail_signature_prefix"><br></span></div><div><span class="gmail_signature_prefix">Actually, I did just take a swing at it.  It was easy.</span></div><div><span class="gmail_signature_prefix"><br></span></div><div><span class="gmail_signature_prefix"><font face="monospace">root@remo:/home/john/xfer # diff keama-leases.py keama-leases-fix.py<br>96a97,98<br>>             if "hardware ethernet" not in v:<br>>                 continue</font></span></div><div><span class="gmail_signature_prefix"><br></span></div><div><span class="gmail_signature_prefix">Can someone help me commit this to git?</span></div><div><span class="gmail_signature_prefix"><br></span></div>-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">John Lind<div><a href="mailto:steinhelten@gmail.com" target="_blank">steinhelten@gmail.com</a></div><div><br></div></div></div></div>