Code review comment for lp:~blake-rouse/maas/fix-1559398

Revision history for this message
Mike Pontillo (mpontillo) wrote :

Looks much better; thanks for the fixes.

I see you've included the host-cleaning functionality in this utility as well. (I didn't look at it in too much detail, but it seems a little scary to do this with a regular expression; you might want to verify that it can't ever match the word "host" inside, for example, a lease block.) So a couple of comments on that:

 - It might be safer to use the ISC parser than a regular expression.
 - I hope we're going to ensure that dhcpd is disabled while we clean the file, since it could be large, and in the time it takes to rewrite the file another lease could easily have been allocated.
 - Could we possibly read the file to determine which host entries we want to remove, and use OMAPI to remove them?

review: Approve

« Back to merge proposal