summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-05-17 21:30:18 +0200
committerChristian Poessinger <christian@poessinger.com>2021-05-17 21:33:41 +0200
commitea96466e46374a810a4d21d4209e6a30feb45de3 (patch)
tree01bb4aeedca77ec6b84b904d640caf698412fc8e /src/op_mode
parent69a0b0a7c6651ce9feb27d2e7626e174515e1fe3 (diff)
downloadvyos-1x-ea96466e46374a810a4d21d4209e6a30feb45de3.tar.gz
vyos-1x-ea96466e46374a810a4d21d4209e6a30feb45de3.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/op_mode')
-rwxr-xr-xsrc/op_mode/dynamic_dns.py4
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': []
}