ValueError Router prompt not found
See original GitHub issueBelow is my script, I was testing to see if automating will work.
from netmiko import ConnectHandler
def switch_helper():
switch
=
{
'device_type':
'aruba_os',
'ip':
'ip',
'username':'username',
'password':'password',
}
to_connect = ConnectHandler(**switch)
output = to_connect.send_command('show ip')
print(output)
if __name__ == ``'__main__':
switch_helper()
The error
Traceback (most recent call last): File “C:/Users/a/Documents/Assist/Switch_Networking/autom.py”, line 42, in <module> switch_helper() File “C:/Users/a/Documents/Assist/Switch_Networking/autom.py”, line 35, in switch_helper to_connect = ConnectHandler(**switch) File “C:\Users\a\AppData\Local\Programs\Python\Python36-32\lib\site-packages\netmiko\ssh_dispatcher.py”, line 168, in ConnectHandler return ConnectionClass(*args, **kwargs) File “C:\Users\a\AppData\Local\Programs\Python\Python36-32\lib\site-packages\netmiko\base_connection.py”, line 188, in init self.session_preparation() File “C:\Users\a\AppData\Local\Programs\Python\Python36-32\lib\site-packages\netmiko\aruba\aruba_ssh.py”, line 15, in session_preparation self.set_base_prompt() File “C:\Users\a\AppData\Local\Programs\Python\Python36-32\lib\site-packages\netmiko\base_connection.py”, line 786, in set_base_prompt raise ValueError(“Router prompt not found: {0}”.format(repr(prompt))) ValueError: Router prompt not found: ‘\x1b[1;24r\x1b[24;1H\x1b[24;1H\x1b[2K\x1b[24;1H\x1b[?25h\x1b[24;1H\x1b[24;1HTee Switch2920# \x1b[24;1H\x1b[24;17H\x1b[24;1H\x1b[?25h\x1b[24;17H’
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
WORKED!!!
Hi @ktbyers I am getting below error for doing ssh in Cisco UCCX device , which device type shall i use . ValueError: Router prompt not found: ‘admin:’
Presently i am using device_type’:‘cisco_ios’
Regards Ranjeet