June 2017
Intermediate to advanced
446 pages
10h 10m
English
Our first program will use the same general structure of the Pexpect program as far as looping over a list of devices and commands, with the exception of using Paramiko instead of Pexpect. This will give us a good compare and contrast of the differences between the two programs.
You can download the the code from the book GitHub repository, https://github.com/PacktPublishing/Mastering-Python-Networking. I will list out the notable differences here:
devices = {'iosv-1': {'ip': '172.16.1.20'}, 'iosv-2': {'ip': '172.16.1.21'}}
We no longer need to match the device prompt using Paramiko, therefore, the device dictionary can be simplified:
commands = ['show version', 'show run']
There is no send line equivalent in ...
Read now
Unlock full access