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:34:41 +0200 |
commit | 9fb7b7560ea8907f4bcae2f44e7373fb2eb99606 (patch) | |
tree | a22d53518d0fcb32955a572e284f11861a296909 /src | |
parent | 07a2564987ddb9100aef274a8509b1cec73c3346 (diff) | |
download | vyos-1x-9fb7b7560ea8907f4bcae2f44e7373fb2eb99606.tar.gz vyos-1x-9fb7b7560ea8907f4bcae2f44e7373fb2eb99606.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.
(cherry picked from commit 041cea6d7a13a804b4e656778048bcefd0a46cb8)
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 14bcf65c1..9d1dccafa 100755 --- a/src/op_mode/dynamic_dns.py +++ b/src/op_mode/dynamic_dns.py @@ -35,6 +35,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': [] } |