fix: get_facts() reads hardware vendor from /tmp/sysinfo/board_name

board_name format is "vendor,model" (e.g. "sophos,ap100"). The prefix
before the comma is title-cased to give the manufacturer name (e.g.
"Sophos"). Falls back to "OpenWrt" when board_name is unavailable.

The model is already read from /tmp/sysinfo/model which gives the full
human-readable name (e.g. "Sophos AP100") — no change needed there.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Manivong
2026-06-22 22:37:25 +02:00
co-authored by Claude Sonnet 4.6
parent 2c0a5e94bf
commit 042a2b6d2e
+6
View File
@@ -189,6 +189,12 @@ class OpenWrtDriver(
release_out = self._send_command("cat /etc/openwrt_release") release_out = self._send_command("cat /etc/openwrt_release")
release = self._parse_openwrt_release(release_out) release = self._parse_openwrt_release(release_out)
# Hardware vendor from board_name (e.g. "sophos,ap100" → "Sophos")
# Fall back to "OpenWrt" when board_name is unavailable or has no comma.
board_name_raw = self._send_command("cat /tmp/sysinfo/board_name 2>/dev/null").strip()
if board_name_raw and "," in board_name_raw and not board_name_raw.startswith("cat:"):
facts["vendor"] = board_name_raw.split(",")[0].strip().title()
else:
facts["vendor"] = "OpenWrt" facts["vendor"] = "OpenWrt"
# Prefer the device-tree model (e.g. "Sophos AP100") over the SoC target # Prefer the device-tree model (e.g. "Sophos AP100") over the SoC target