diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-05-17 21:30:18 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-05-17 21:32:33 +0200 |
commit | 041cea6d7a13a804b4e656778048bcefd0a46cb8 (patch) | |
tree | 739c0e71c2be0e2bebbd0a3721ee450e7cc6b878 /src | |
parent | 0a1e22336c2ead01b607b5b6bb52383e4840645c (diff) | |
download | vyos-1x-041cea6d7a13a804b4e656778048bcefd0a46cb8.tar.gz vyos-1x-041cea6d7a13a804b4e656778048bcefd0a46cb8.zip |
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.
Diffstat (limited to 'src')
-rwxr-xr-x | src/op_mode/dynamic_dns.py | 4 |
1 files changed, 4 insertions, 0 deletions
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': [] } |