Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-standard platform slug not fully supported #91

Open
JostLuebbe opened this issue Jun 12, 2023 · 0 comments
Open

Non-standard platform slug not fully supported #91

JostLuebbe opened this issue Jun 12, 2023 · 0 comments

Comments

@JostLuebbe
Copy link

Hello,

I wasn't sure under which Github repository to leave this issue so if I should open it under the nornir_netmiko library instead let me know.

Issue

The nornir_nautobot library allows us to map non-standard platform slugs to the correct [Nornir Dispatcher class].(https://docs.nautobot.com/projects/plugin-nornir/en/latest/user/app_feature_dispatcher/#configuring-the-dispatcher)

This is very convenient, and I was attempting to take advantage of this but noticed my Nautobot Golden Config backup jobs were still failing. Here is the code trace I've done and what I believe is the root cause of the failure:

  1. nornir_nautobot selects the correct dispatched based on the extra configurations we make, and eventually ends up in the get_config method of the NetmikoNautobotNornirDriver class:
    https://github.com/nautobot/nornir-nautobot/blob/develop/nornir_nautobot/plugins/tasks/dispatcher/default.py
  2. This method calls the netmiko_send_command task.
  3. This then attempts to establish a Netmiko connection object:
    https://github.com/ktbyers/nornir_netmiko/blob/develop/nornir_netmiko/tasks/netmiko_send_command.py
    https://github.com/ktbyers/nornir_netmiko/blob/develop/nornir_netmiko/connections/netmiko.py
  4. This connection object attempts to use the platform string to map to the correct Netmiko device_type:
napalm_to_netmiko_map = {
    "ios": "cisco_ios",
    "nxos": "cisco_nxos",
    "nxos_ssh": "cisco_nxos",
    "eos": "arista_eos",
    "junos": "juniper_junos",
    "iosxr": "cisco_xr",
}

However, because we are using a non-standard platform string this mapping fails and throws an exception.

The Ask

Would it be possible to allow us to either also configure the napalm_to_netmiko_map to include our non-standard platform strings, or have some way of passing an overriding platform value when calling the netmiko_send_command task and establishing the Netmiko connection.

Another possibility may be to use the Napalm driver instead, but I also believe there modifications would be necessary to pass a configured platform slug.

I am of course open to any other suggestions or ideas you may have for working around this issue and please let me know if you'd like more information.

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

No branches or pull requests

1 participant