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:
co-authored by
Claude Sonnet 4.6
parent
2c0a5e94bf
commit
042a2b6d2e
@@ -189,7 +189,13 @@ class OpenWrtDriver(
|
||||
release_out = self._send_command("cat /etc/openwrt_release")
|
||||
release = self._parse_openwrt_release(release_out)
|
||||
|
||||
facts["vendor"] = "OpenWrt"
|
||||
# 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"
|
||||
|
||||
# Prefer the device-tree model (e.g. "Sophos AP100") over the SoC target
|
||||
model_raw = self._send_command("cat /tmp/sysinfo/model 2>/dev/null")
|
||||
|
||||
Reference in New Issue
Block a user