Open VeryVVell opened 1 month ago
You need to call dev._open()
if you are going to bypass the normal connection process (i.e. if you set auto_connect=False
).
So code should be:
params = {
'device_type': 'cisco_ios',
'host': '10.50.51.126',
'username': 'wizard',
'password': 'sanfra',
'secret': 'cisco',
'auto_connect': False,
'verbose': True,
}
dev = netmiko.ConnectHandler(**params)
dev._open()
dev.enable()
Thanks a million for your help!
Description of Issue/Question
When ConnectHandler is initialized without parameter 'auto_connect' all works as expected, but if I submit 'auto_connect' = False to ConnectHandler and invoke establish_connection(), then subsequent enable() fails with error:
ValueError: Failed to enter enable mode. Please ensure you pass the 'secret' argument to ConnectHandler.
Netmiko version
Netmiko device_type (if relevant to the issue)
Steps to Reproduce the Issue
Error Traceback
Relevant Python code