Skip to content

Commit

Permalink
fix: add missing default supported drivers (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoparente authored Jan 30, 2025
1 parent f51eda1 commit 54b6f12
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ __pycache__/
.pytest_cache/
.ruff_cache/
*.egg-info/
.coverage/
.coverage/
.coverage
2 changes: 1 addition & 1 deletion device-discovery/device_discovery/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def napalm_driver_list() -> list[str]:
discovered driver names from the installed packages.
"""
napalm_packages = ["ios", "eos", "junos", "nxos"]
napalm_packages = ["eos", "ios", "iosxr_netconf", "junos", "nxos", "nxos_ssh"]
prefix = "napalm_"
for dist in packages_distributions():
if dist.startswith(prefix):
Expand Down
13 changes: 11 additions & 2 deletions device-discovery/tests/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,16 @@ class MockDriver(NetworkDriver):

mock_packages_distributions.return_value = mock_distributions

expected_drivers = ["ios", "eos", "junos", "nxos", "srl", "fake_driver"]
expected_drivers = [
"eos",
"ios",
"iosxr_netconf",
"junos",
"nxos",
"nxos_ssh",
"srl",
"fake_driver",
]
drivers = napalm_driver_list()
assert drivers == expected_drivers, f"Expected {expected_drivers}, got {drivers}"

Expand All @@ -209,7 +218,7 @@ def test_napalm_driver_list_error(mock_packages_distributions, mock_import_modul

mock_import_module.side_effect = Exception("Import failed")
mock_packages_distributions.return_value = mock_distributions
expected_drivers = ["ios", "eos", "junos", "nxos"]
expected_drivers = ["eos", "ios", "iosxr_netconf", "junos", "nxos", "nxos_ssh"]

with patch("device_discovery.discovery.logger") as mock_logger:
drivers = napalm_driver_list()
Expand Down

0 comments on commit 54b6f12

Please sign in to comment.