mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-02-26 20:27:31 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bf5ea4a05 | ||
|
|
7f6327e94e |
@@ -240,7 +240,9 @@ class APIHost(CoreSysAttributes):
|
||||
f"Cannot determine CONTAINER_LOG_EPOCH of {identifier}, latest logs not available."
|
||||
) from err
|
||||
|
||||
if ACCEPT in request.headers and request.headers[ACCEPT] not in [
|
||||
accept_header = request.headers.get(ACCEPT)
|
||||
|
||||
if accept_header and accept_header not in [
|
||||
CONTENT_TYPE_TEXT,
|
||||
CONTENT_TYPE_X_LOG,
|
||||
"*/*",
|
||||
@@ -250,7 +252,7 @@ class APIHost(CoreSysAttributes):
|
||||
"supported for now."
|
||||
)
|
||||
|
||||
if "verbose" in request.query or request.headers[ACCEPT] == CONTENT_TYPE_X_LOG:
|
||||
if "verbose" in request.query or accept_header == CONTENT_TYPE_X_LOG:
|
||||
log_formatter = LogFormatter.VERBOSE
|
||||
|
||||
if "no_colors" in request.query:
|
||||
|
||||
@@ -304,14 +304,38 @@ class DeviceType(DBusIntEnum):
|
||||
UNKNOWN = 0
|
||||
ETHERNET = 1
|
||||
WIRELESS = 2
|
||||
UNUSED1 = 3
|
||||
UNUSED2 = 4
|
||||
BLUETOOTH = 5
|
||||
OLPC_MESH = 6
|
||||
WIMAX = 7
|
||||
MODEM = 8
|
||||
INFINIBAND = 9
|
||||
BOND = 10
|
||||
VLAN = 11
|
||||
ADSL = 12
|
||||
BRIDGE = 13
|
||||
GENERIC = 14
|
||||
TEAM = 15
|
||||
TUN = 16
|
||||
IP_TUNNEL = 17
|
||||
MAC_VLAN = 18
|
||||
VXLAN = 19
|
||||
VETH = 20
|
||||
MACSEC = 21
|
||||
DUMMY = 22
|
||||
PPP = 23
|
||||
OVS_INTERFACE = 24
|
||||
OVS_PORT = 25
|
||||
OVS_BRIDGE = 26
|
||||
WPAN = 27
|
||||
LOWPAN6 = 28
|
||||
WIREGUARD = 29
|
||||
WIFI_P2P = 30
|
||||
VRF = 31
|
||||
LOOPBACK = 32
|
||||
HSR = 33
|
||||
IPVLAN = 34
|
||||
|
||||
|
||||
class WirelessMethodType(DBusIntEnum):
|
||||
|
||||
@@ -374,6 +374,11 @@ async def test_advanced_logs_formatters(
|
||||
await api_client.get("/host/logs/identifiers/test", headers=headers)
|
||||
journal_logs_reader.assert_called_once_with(ANY, LogFormatter.VERBOSE, False)
|
||||
|
||||
journal_logs_reader.reset_mock()
|
||||
|
||||
await api_client.get("/host/logs/identifiers/test", skip_auto_headers={"Accept"})
|
||||
journal_logs_reader.assert_called_once_with(ANY, LogFormatter.PLAIN, False)
|
||||
|
||||
|
||||
async def test_advanced_logs_errors(coresys: CoreSys, api_client: TestClient):
|
||||
"""Test advanced logging API errors."""
|
||||
|
||||
Reference in New Issue
Block a user