refactor(system-identity): keep SystemIdentityDict with its mixin
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 57s
driver / test (3.13) (pull_request) Successful in 1m6s
driver / test (3.12) (pull_request) Successful in 1m15s
driver / lowest (pull_request) Successful in 38s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 1m4s
CI / driver (pull_request) Successful in 2m51s
driver / publish (pull_request) Skipped

models.py is over its line limit and may not grow; the dict has no other
user than system_identity.py, as clusters.py and apt_proxy.py keep theirs.

NetOrk/netork#2518
This commit is contained in:
christianmanivong committed 2026-11-13 23:04:18 +01:00
1 parent 9ecc6823c8
commit c25f39768f
3 files changed
+16 -18

No files matched your search

-15
View File
@@ -1440,18 +1440,3 @@ class ManagementProtocolsDict(TypedDict):
snmp: ProtocolStateDict
kvm: ProtocolStateDict
virtual_media: ProtocolStateDict
class SystemIdentityDict(TypedDict):
"""A host's SMBIOS identity, what ties it to its BMC, and its system firmware.
See :mod:`napalm_device_types.system_identity`.
Each value is empty when unknown or a vendor placeholder."""
system_uuid: str # lowercase
product_serial: str
board_serial: str
bios_vendor: str # the system firmware (BIOS or UEFI): its vendor,
bios_version: str # its version,
bios_date: str # its release date, YYYY-MM-DD
+15 -2
View File
@@ -25,11 +25,24 @@ from __future__ import annotations
import re
from datetime import date
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, TypedDict
from napalm_device_types.models import SystemIdentityDict
from napalm_device_types.terminal import strip_terminal_codes
class SystemIdentityDict(TypedDict):
"""A host's SMBIOS identity, what ties it to its BMC, and its system firmware.
Each value is empty when unknown or a vendor placeholder."""
system_uuid: str # lowercase
product_serial: str
board_serial: str
bios_vendor: str # the system firmware (BIOS or UEFI): its vendor,
bios_version: str # its version,
bios_date: str # its release date, YYYY-MM-DD
_BEGIN = "IDBEGIN"
_END = "IDEND"
_DMI = "/sys/class/dmi/id"