Skip to content

Conversation

@leoparente
Copy link
Contributor

@leoparente leoparente commented Dec 11, 2025

This pull request introduces custom NAPALM driver extensions for device inventory collection and integrates them into the device discovery workflow. It adds new modules for Cisco IOS and Nokia SR Linux devices, updates the policy runner to use these inventory helpers, and enhances testing for inventory data handling and error resilience.

Custom NAPALM driver extensions:

  • Added custom_napalm package with IOSDriver and NokiaSRLDriver classes that extend the base NAPALM drivers to provide a get_inventory method for device inventory retrieval. The IOS driver uses ntc-templates to parse the output of show inventory. ([[1]](https://github.com/netboxlabs/orb-discovery/pull/224/files#diff-d9b1947fdc39b37237acf9cf61e73b4a46f0c9179c4348f593206c9e1daba648R1-R6), [[2]](https://github.com/netboxlabs/orb-discovery/pull/224/files#diff-fe7f229492e15b72a3d219003ff2801916975e3c5895bd4fe6d6994805f14d00R1-R24), [[3]](https://github.com/netboxlabs/orb-discovery/pull/224/files#diff-8b8722f390ff59da050bd013da7cf3bb083688f5357963f8d9adcdc9e39a841bR1-R11))
  • Registered the new custom_napalm package in the project configuration for packaging and distribution. ([device-discovery/pyproject.tomlR57](https://github.com/netboxlabs/orb-discovery/pull/224/files#diff-c3df0d5da015312295fa2fdd2c07560e9b424071533c1e579856a8d757072d58R57))

Device discovery workflow enhancements:

  • Updated _collect_device_data in policy/runner.py to call get_inventory (or get_site_code as fallback) if available on the driver, storing the result in the discovery data. Handles errors gracefully and logs warnings if inventory retrieval fails. ([device-discovery/device_discovery/policy/runner.pyR190-R202](https://github.com/netboxlabs/orb-discovery/pull/224/files#diff-39f0ea02f8aa249588ad02adba4c7118014ed39bcc962ae619cb8b20a662220fR190-R202))

Dependency updates:

  • Added ntc-templates as a required dependency for parsing Cisco IOS inventory output. ([device-discovery/pyproject.tomlR40](https://github.com/netboxlabs/orb-discovery/pull/224/files#diff-c3df0d5da015312295fa2fdd2c07560e9b424071533c1e579856a8d757072d58R40))

Testing improvements:

  • Enhanced tests to verify that inventory data is included in discovery results when available and that errors in custom driver methods are handled without breaking the workflow. ([[1]](https://github.com/netboxlabs/orb-discovery/pull/224/files#diff-b532d3732249713542c40eb5bb38fef6adfbee621e934fa42f4444693b461695R151), [[2]](https://github.com/netboxlabs/orb-discovery/pull/224/files#diff-b532d3732249713542c40eb5bb38fef6adfbee621e934fa42f4444693b461695R168-R201))

@leoparente leoparente self-assigned this Dec 11, 2025
@github-actions
Copy link

github-actions bot commented Dec 11, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
device_discovery
   discovery.py63297%142–145
   main.py49296%181, 187
   metrics.py53198%114
   server.py821088%35–37, 63–78, 168, 171
   translate.py173299%87, 89
   version.py7186%14
device_discovery/policy
   manager.py41295%36–37
   runner.py126298%186–187
TOTAL6992297% 

Tests Skipped Failures Errors Time
80 0 💤 0 ❌ 0 🔥 7.381s ⏱️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants