Python NAPALM example Cisco configuration replace rollback compare commit | Part 34|

Published: 17 May 2019
on channel: NetworkEvolution
4,142
37

𝗙𝗼𝗿 𝗖𝗼𝗺𝗽𝗹𝗲𝘁𝗲 𝗣𝘆𝘁𝗵𝗼𝗻 𝗙𝗼𝗿 𝗡𝗲𝘁𝘄𝗼𝗿𝗸 𝗘𝗻𝗴𝗶𝗻𝗲𝗲𝗿𝘀 𝗖𝗼𝘂𝗿𝘀𝗲:
𝗘𝗻𝗿𝗼𝗹𝗹 𝗳𝗼𝗿 𝗯𝗲𝗹𝗼𝘄 𝗨𝗱𝗲𝗺𝘆 𝗖𝗹𝗮𝘀𝘀: 𝟐𝟎𝟐𝟐 𝐕𝐞𝐫𝐬𝐢𝐨𝐧
𝑫𝒊𝒔𝒄𝒐𝒖𝒏𝒕𝒆𝒅 𝑹𝒆𝒇𝒆𝒓𝒓𝒂𝒍 𝑳𝒊𝒏𝒌:
https://www.udemy.com/course/python-f... Cisco configuration management using NAPALM python library. Example how to compare commit replace rollback and discard configuration changes in devices.

from napalm import get_network_driver
driver = get_network_driver('ios')
device = driver('192.168.67.47', 'admin', 'admin')
device.open()

device.load_replace_candidate(filename='30_cisco_backup')
print (device.compare_config())

if len(device.compare_config()) 0:
choice = input("\nWould you like to Replace the Configuration file? [yN]: ")
if choice == 'y':
print('Committing ...')
device.commit_config()

choice = input("\nWould you like to Rollback to previous config? [yN]: ")
if choice == 'y':
print('Rollback config is in progress ...')
device.rollback()
else:
print('Discarding ...')
device.discard_config()
else:
print ('No difference')

device.close()
print('Done.')


On this page of the site you can watch the video online Python NAPALM example Cisco configuration replace rollback compare commit | Part 34| with a duration of hours minute second in good quality, which was uploaded by the user NetworkEvolution 17 May 2019, share the link with friends and acquaintances, this video has already been watched 4,142 times on youtube and it was liked by 37 viewers. Enjoy your viewing!