nautobot / nautobot-app-golden-config

Golden Configuration App for Nautobot.
https://docs.nautobot.com/projects/golden-config/en/latest/
Other
100 stars 57 forks source link

Network Driver Mappings not working correctly #716

Closed FouxFox closed 8 months ago

FouxFox commented 9 months ago

Environment

Expected Behavior

Setting Admin > Config > Device Connectivity > Network Drivers to { "netmiko": { "my_network_driver": "my_network_driver" } "netutils_parser": { "my_network_driver": "juniper_junos" } }

When a network driver translation is set in Nautobot, this should affect Compliance jobs, but appears not to.

Observed Behavior

I receive the following error in the Job log: E3003: There is currently no CLI-config parser support for platform network_driver my_network_driver, preemptively failed.

Steps to Reproduce

  1. Populate a Network Driver Mapping as shown above.
  2. Add a Platform and device utilizing my_network_driver for the network driver.
  3. Populate git repos with dummy intended, backup, and template configs
  4. Attempt to run a compliance job.

Comments

Based on the code, config_compliance.py grabs a list of platforms supported by netutils here, but the code references the netmiko driver here rather than referencing obj.platform.network_driver_mappings["netutils_parser"].

I've managed to workaround this problem by adding "my_network_driver": parser.JunosConfigParser, to the parser map in netutils/config/compliance.py.