cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Who Me Too'd this topic

NETMIKO no username command

Jhonata
Level 1
Level 1

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

 

 

Who Me Too'd this topic