ktbyers / netmiko

Multi-vendor library to simplify Paramiko SSH connections to network devices
MIT License
3.61k stars 1.31k forks source link

Issue using send_config_set() on Juniper devices #3491

Open MRreddy143 opened 2 months ago

MRreddy143 commented 2 months ago

Description of Issue/Question please help to fix i tried all expect_string also ,

to see how to properly format your request.

i tried to configuration in juniper using the netmiko getting error ,

command= 'deactivate protocols isis interface ae5.13 level 2 metric' -------------> this is executing in manual , all delete is not working with the send_config_set print(dev_connect.find_prompt()) output_Name_server=dev_connect.send_config_set() output_Name_server=dev_connect.send_config_set(commands,exit_config_mode=False,strip_command=False,strip_prompt=False,read_timeout=100) output_Name_server=output_Name_server+dev_connect.commit(and_quit=True)

error is :--

Pattern not detected: 'delete\ protocols\ isis\ interface\ ae5.13\ level\ 2\ hello-interval' in output.

Things you might try to fix this:

Adjust the regex pattern to better identify the terminating string. Note, in many situations the pattern is automatically based on the network device's prompt. Increase the read_timeout to a larger value. You can also look at the Netmiko session_log or debug log for more information.

Originally posted by @MRreddy143 in https://github.com/ktbyers/netmiko/discussions/3476

ktbyers commented 1 month ago
# -------------> this is executing in manual , all delete is not working with the send_config_set
command= 'deactivate protocols isis interface ae5.13 level 2 metric' 
print(dev_connect.find_prompt())
output_Name_server=dev_connect.send_config_set()
output_Name_server=dev_connect.send_config_set(
    commands,
    exit_config_mode=False,
    strip_command=False,
    strip_prompt=False,
    read_timeout=100
)
output_Name_server=output_Name_server+dev_connect.commit(and_quit=True)

command and commands are not the same variable.

command is set to: 'deactivate protocols isis interface ae5.13 level 2 metric'

But error refers to:

Pattern not detected: 'delete\ protocols\ isis\ interface\ ae5.13\ level\ 2\ hello-interval' in output.

Which aren't the same?