feat: report the licenses a BMC asks for as facts (0.5.0)

get_licenses (napalm-device-types LicenseMixin, 4.15) on redfish and bmc,
for NetOrk/netork#1111.

- A BMC that refuses Redfish altogether reports each license it names as
  missing, with its message.
- One that answers but withholds parts reports the license with withholds,
  e.g. DCMS withholding drives and the firmware inventory on an X10 with
  only SFT-OOB-LIC.
- ipmi knows no licenses.

get_device_warnings keeps its two codes until netOrk derives them.
This commit is contained in:
Christian Manivong committed 2026-10-17 11:32:59 +02:00
1 parent e9ad7951cd
commit 5b24675a12
9 files changed
+86 -7

No files matched your search

+6 -2
View File
@@ -23,7 +23,7 @@ import logging
from typing import Any
from napalm.base.exceptions import ConnectionException
from napalm_device_types import HealthMetricsMixin, ManagementControllerDriver
from napalm_device_types import HealthMetricsMixin, LicenseMixin, ManagementControllerDriver
from napalm_redfish.driver import BMC_HTTP_FINGERPRINT, BMC_PORT_SPECS, RedfishDriver
from napalm_redfish.ipmi import IpmiDriver
@@ -35,7 +35,7 @@ _JsonDict = dict[str, Any]
_IPMI_PORT = 623
class BmcDriver(HealthMetricsMixin, ManagementControllerDriver):
class BmcDriver(HealthMetricsMixin, LicenseMixin, ManagementControllerDriver):
"""One BMC over Redfish and IPMI: Redfish first, IPMI where Redfish does not answer."""
platform = "bmc"
@@ -137,6 +137,10 @@ class BmcDriver(HealthMetricsMixin, ManagementControllerDriver):
def get_snmp_information(self) -> _JsonDict:
return self._call("get_snmp_information")
def get_licenses(self) -> list[_JsonDict]:
"""Redfish's license facts, also while IPMI reads the BMC: IPMI knows none."""
return self._redfish.get_licenses()
def get_device_warnings(self) -> list[_JsonDict]:
"""Redfish's signals; for a BMC that refuses Redfish, with ``ipmi_fallback`` set, as
this driver reads it over IPMI meanwhile."""