refactor(copilot): rename Huawei CE driver and add Ruijie tests with format fixes

- Rename huawei_telnet_ce to gns3_huawei_telnet_ce for consistent naming
   - Add comprehensive test suite for RuijieTelnetEnhanced driver (10 tests)
   - Update list_netmiko_telnet_devices.py to include gns3_ruijie_telnet
   - Fix all flake8 format issues (line length, unused imports, variables)
   - Update documentation to reflect device type rename
This commit is contained in:
YueGuobin committed 2026-03-14 00:08:13 +08:00
1 parent 6e88582ff1
commit c76982b29e
11 files changed
+451 -91

No files matched your search

@@ -72,7 +72,7 @@ def register_custom_drivers() -> set:
import huawei_ce
# Store custom device types before registration
custom_devices.add("huawei_telnet_ce")
custom_devices.add("gns3_huawei_telnet_ce")
# The driver auto-registers on import, but we can call it
# explicitly
@@ -84,7 +84,29 @@ def register_custom_drivers() -> set:
except Exception as e:
# Log but don't fail
print(
f"Warning: Failed to register custom drivers: {e}",
f"Warning: Failed to register Huawei CE driver: {e}",
file=sys.stderr
)
try:
# Import and register Ruijie Telnet driver
from gns3server.agent.gns3_copilot.utils.custom_netmiko \
import ruijie_telnet
# Store custom device types before registration
custom_devices.add("gns3_ruijie_telnet")
# The driver auto-registers on import, but we can call it
# explicitly
if hasattr(ruijie_telnet, 'register_custom_device_type'):
ruijie_telnet.register_custom_device_type()
except ImportError:
# Silently skip if custom drivers are not available
pass
except Exception as e:
# Log but don't fail
print(
f"Warning: Failed to register Ruijie driver: {e}",
file=sys.stderr
)