feat: TYPE_LABEL = "Storage" replaces storage_device = True flag

The TYPE_LABEL attribute on the base class hierarchy is now the
canonical way for drivers to declare their device category. The
storage_device sentinel flag is removed — classification is determined
by reading TYPE_LABEL via getattr() in the backend.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Manivong
2026-06-24 11:38:36 +02:00
co-authored by Claude Sonnet 4.6
parent 07b68cd73f
commit 46c4c13f3d
7 changed files with 48 additions and 27 deletions
Binary file not shown.
+18
View File
@@ -0,0 +1,18 @@
"""Tests for TYPE_LABEL on OpenMediaVaultDriver."""
from napalm_openmediavault.openmediavault import OpenMediaVaultDriver
def test_type_label_is_storage():
assert OpenMediaVaultDriver.TYPE_LABEL == "Storage"
def test_type_label_overrides_linux():
from napalm_linux.linux import LinuxDriver
assert LinuxDriver.TYPE_LABEL == "Linux"
assert OpenMediaVaultDriver.TYPE_LABEL != LinuxDriver.TYPE_LABEL
def test_storage_device_flag_removed():
assert not hasattr(OpenMediaVaultDriver, "storage_device"), \
"storage_device is superseded by TYPE_LABEL = 'Storage'"