From 041cea6d7a13a804b4e656778048bcefd0a46cb8 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 17 May 2021 21:30:18 +0200 Subject: ddclient: T3557: fix FileNotFoundError when querying status information If ddclient is not problery configured it will start up but no status file is generated. This commit checks if the status file exists before reading it. --- src/op_mode/dynamic_dns.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/op_mode/dynamic_dns.py b/src/op_mode/dynamic_dns.py index 962943896..f9a1aad38 100755 --- a/src/op_mode/dynamic_dns.py +++ b/src/op_mode/dynamic_dns.py @@ -36,6 +36,10 @@ update-status: {{ entry.status }} """ def show_status(): + # A ddclient status file must not always exist + if not os.path.exists(cache_file): + sys.exit(0) + data = { 'hosts': [] } -- cgit v1.2.3