> read_dnsmasq_log_file() will raise FileNotFoundError if dnsmasq hasn’t created the
> log file yet (or if the file was just removed by stop_dnsmasq() before the restart).
> This would error the test instead of retrying.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
success = False
for _ in range(20):
time.sleep(0.5)
- output = read_dnsmasq_log_file()
+ try:
+ output = read_dnsmasq_log_file()
+ except FileNotFoundError:
+ output = ""
if 'DHCPRELEASE' in output:
success = True
break