nornir-nautobot icon indicating copy to clipboard operation
nornir-nautobot copied to clipboard

GC platform_slug_map with nornir-nautobot dispatcher mapping can lead to issues

Open jeffkala opened this issue 1 year ago • 2 comments

Seems like some interop with using platform_slug_map from golden config and overloading a platform from that map in the dispatcher.

GC user has platform map of:

        "platform_slug_map": {"junos": "juniper_junos"},

And dispatcher point to netmiko juniper_junos

        "dispatcher_mapping": {
            "juniper_junos": "nornir_nautobot.plugins.tasks.dispatcher.juniper_junos.NautobotNornirDriver"
        }

Issue:

with dispatcher_mapping set to juniper_junos getting:

Unable to find the driver for check_connectivity for platform: junos

if setting the dispatcher_mapping to junos getting:

                                      ^
syntax error, expecting <command>.

While debugging this is because its pulling back command to run based on default key which is show run.

Workaround is to update:

https://github.com/nautobot/nornir-nautobot/blob/bb977910f9e711fe2190a71d61b641f277e73b80/nornir_nautobot/plugins/tasks/dispatcher/default.py#LL29C1-L37C2

and in this case add a junos key.

jeffkala avatar May 04 '23 19:05 jeffkala