Pure functions for ServiceRoot, ComputerSystem (facts, power state, reset action and ActionInfo), Processors, Memory, Storage/Drives/SimpleStorage, Chassis Thermal and Power as well as ThermalSubsystem/PowerSubsystem/Sensors (with environment_sources to pick whichever exists), Manager, EthernetInterfaces, ManagerNetworkProtocol, accounts, firmware inventory and log services/entries.
24 lines
801 B
Python
24 lines
801 B
Python
"""UpdateService firmware inventory (``UpdateService/FirmwareInventory/*``)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Mapping
|
|
|
|
from .common import boolean, link_list, status, text
|
|
|
|
|
|
def parse_firmware(item: Mapping[str, Any]) -> dict[str, Any]:
|
|
"""One SoftwareInventory member: what it is, its version, whether it can be updated."""
|
|
state, health = status(item)
|
|
return {
|
|
"id": text(item.get("Id")),
|
|
"name": text(item.get("Name")),
|
|
"version": text(item.get("Version")),
|
|
"updateable": boolean(item.get("Updateable")),
|
|
"manufacturer": text(item.get("Manufacturer")),
|
|
"release_date": text(item.get("ReleaseDate")),
|
|
"state": state,
|
|
"health": health,
|
|
"related": link_list(item, "RelatedItem"),
|
|
}
|