10-25-2022 07:15 AM
I am running a script with Netmiko to erase a username on around 2000 switches, It is working but when the user was already erasing it, netmiko shows an error because is expecting a confirmation to delete, how can I condition expect to have two possible outcomes
When the user is in the configuration there is not problem, but is not there, netmiko is expecting a string 'confirm'
output=net_connect.send_command('no username XXXXXXXX',
expect_string = r'confirm')
output+=net_connect.send_command('\n', expect_string=r'#') #Confirm command
Solved! Go to Solution.