Do not update netmiko to version 5 if you are using it with nornir

I have been using nornir to call netmiko, the netmiko version used by nornir is version 2.4.2, netmiko has just updated to version 3.0, before I upgraded the netmiko, I could push config set. After I upgraded netmiko to 3.0, my script started raised netmiko timeout, but the commands were sent to the firewall. From the logs these are the exceptions:

2020-02-13 16:10:51,541 - nornir.core.task -    ERROR -      start() - Host 'fw03': task 'asa_add_config' failed with traceback:
Traceback (most recent call last):
  File "C:\Users\cyruslab\PycharmProjects\netautoapi\lib\site-packages\nornir\core\", line 85, in start
    r = self.task(self, **self.params)
  File "C:\Users\cyruslab\PycharmProjects\netautoapi\network\", line 177, in asa_add_config["config"])
  File "C:\Users\cyruslab\PycharmProjects\netautoapi\lib\site-packages\nornir\core\", line 147, in run
    raise NornirSubTaskError(task=task, result=r)
nornir.core.exceptions.NornirSubTaskError: Subtask:  (failed)

2020-02-13 16:12:06,997 -  nornir.core -     INFO -        run() - Running task 'close_connections_task' with args {} on 3 hosts
2020-02-13 16:12:07,127 -  nornir.core -     INFO -        run() - Running task 'asa_add_config' with args {'template': 'asa_obj_net_confg.j2', 

The weird thing is although exceptions were thrown, commands were still sent to the firewall, however false positive was generated on my api response. So to verify if it is due to compatibility issue I downgrade netmiko back to 2.4.2 and my response becomes successful and commands are sent.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s