fix: group alternative fingerprint rules (0.1.2)

One Redfish answer (the service root or the error a service refuses it
with) and one landing page (Supermicro/ATEN, iDRAC or iLO) can match,
never all of them. Grouped, the driver's maximum in netOrk's discovery
is 21 instead of 41, and a Supermicro landing page alone (6 of 21)
outranks the "linux" its BMC reports over SNMP (5 of 18).

Requires napalm-device-types 4.8 for FingerprintRule.group.
This commit is contained in:
christianmanivong committed 2026-10-13 10:19:56 +02:00
1 parent 93bbc63f3d
commit bfbeb19255
5 files changed
+35 -9

No files matched your search

+1 -1
View File
@@ -2,5 +2,5 @@
from napalm_redfish.driver import RedfishDriver
__version__ = "0.1.1"
__version__ = "0.1.2"
__all__ = ["RedfishDriver"]
+8 -6
View File
@@ -112,16 +112,18 @@ class RedfishDriver(ManagementControllerDriver):
#: Every Redfish service answers ``GET /redfish/v1/`` without credentials. The port
#: itself is worth nothing: every switch with a web UI answers on 443.
PORT_SPECS = [PortSpec("https", 443, ("/redfish/v1/",), weight=0.0)]
#: Rules in one group are alternatives and count once towards the maximum
#: (napalm-device-types' ``rules_max_weight``).
HTTP_FINGERPRINT = [
# The service root, and the error body a service refuses it with (an unlicensed
# The service root, or the error body a service refuses it with (an unlicensed
# Supermicro X10 answers 403 with a Redfish error).
FingerprintRule("redfishversion", 10.0),
FingerprintRule("redfishversion", 10.0, group="redfish_answer"),
FingerprintRule("@message.extendedinfo", 8.0, group="redfish_answer"),
FingerprintRule("#serviceroot.", 5.0),
FingerprintRule("@message.extendedinfo", 8.0),
# Landing pages of the BMC web UIs: Supermicro X9-X11 (ATEN firmware), iDRAC, iLO.
FingerprintRule("aten international", 6.0),
FingerprintRule("idrac", 6.0),
FingerprintRule("integrated lights-out", 6.0),
FingerprintRule("aten international", 6.0, group="landing_page"),
FingerprintRule("idrac", 6.0, group="landing_page"),
FingerprintRule("integrated lights-out", 6.0, group="landing_page"),
]
#: A BMC restart takes a few minutes before Redfish answers again.
REBOOT_SETTLE_SECONDS = 180