Verified Commit 71a3ea87 authored by Karel Koci's avatar Karel Koci 🤘
Browse files

svupdater/branch: define default for mode

Although mode should be always set it can be removed by user. We should
not just fail with exception when we know that branch is the default
mode. That means instead just fallback to branch.
parent 7e3b9b0f
......@@ -4,7 +4,7 @@ from euci import EUci
def get_os_branch_or_version():
"""Get OS branch or version from uci."""
with EUci() as uci:
mode = uci.get("updater", "turris", "mode", dtype=str)
mode = uci.get("updater", "turris", "mode", dtype=str, default="branch")
value = uci.get("updater", "turris", mode, dtype=str, default="")
if mode == "version" and not value:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment