Closed pnikila closed 2 weeks ago
I would probably try to call set_base_prompt()
before you make your .enable()
call, here:
if '>' in prompt:
netmiko_device.enable()
Let me know if that fixes the issue.
Thanks @ktbyers. It is working now.
Description of Issue/Question
I am resetting a switch using serial(console) connection with write erase and reload. And Checking the prompt to see if reload is completed. Once reload is completed, we need to add additional configs like username and password and other basic commands.
Setup
device_dict_cisco_serial = { "device_type" : "terminal_server", "ip":device_dict_cisco["serial_ip"], "port":device_dict_cisco["serial_port"], "username":device_dict_cisco["serial_username"], "password":device_dict_cisco["serial_password"], "global_delay_factor": 3, "session_log":device_dict_cisco["session_log"], "secret":device_dict_cisco["secret"] } netmiko_dev = ConnectHandler(**device_dict_cisco_serial) netmiko.redispatch(netmiko_dev, device_type=device_dict_cisco["device_type"])
Netmiko version
(Paste verbatim output from
pip freeze | grep netmiko
between quotes below)Netmiko device_type (if relevant to the issue)
(Paste
device_type
between quotes below)Steps to Reproduce the Issue
1)Connect to serial console 2) Give "Write erase" 3) Give reload 4) There is change in hostname after reload command is issued .
Error Traceback
(Paste the complete traceback of the exception between quotes below)
Relevant Python code
(Please try to essentialize your Python code to the minimum code needed to reproduce the issue) (Paste the code between the quotes below)