Verified Commit 608b2c68 authored by Martin Matějek's avatar Martin Matějek
Browse files

Get TOS branch or version from uci

parent 4663b590
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)
value = uci.get("update", "turris", mode, dtype=str, default="")
if mode == "version" and not value:
# fallback to branch when no version is provided
mode = "branch"
if mode == "branch" and not value:
value = "hbs"
return mode, 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