Success - But Why :) #2534
Unanswered
ynysmeudwy
asked this question in
Q&A
Replies: 1 comment
-
I believe the default delay_factor=1.0 in send_command_timing paused the script long enough for your gear to catch up. You can try your original script and experiment by adding global_ delay_factor=2.0 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi I have managed to resolve my issue with help from Kirks examples but I dont understand why so the code that is commented out below failed but when I re-wrote it then it successfully sent the 'y' and completed the task? Sorry if this is a naïve question.
for i in al:
nokia = {
'host': i,
'device_type': 'alcatel_sros',
'username': ur,
'password': pw,
'session_log': 'netmiko.log',
}
cmd = 'y'
cmd2 = 'candidate edit'
cmd3 = 'candidate discard'
This is the debug output (Node name removed).
Failure Output:
DEBUG:netmiko:write_channel: b'environment no more\n'
DEBUG:netmiko:Pattern is: environment\ no\ more
DEBUG:netmiko:_read_channel_expect read_data: envir
DEBUG:netmiko:_read_channel_expect read_data: onment no more
*A:#
DEBUG:netmiko:Pattern found: environment\ no\ more environment no more
*A:#
DEBUG:netmiko:environment no more
*A:#
DEBUG:netmiko:Exiting disable_paging
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'candidate edit\n'
DEBUG:netmiko:Pattern is: candidate\ edit
DEBUG:netmiko:_read_channel_expect read_data: candi
DEBUG:netmiko:_read_channel_expect read_data: date edit
INFO: CLI There are uncommitted changes in the candidate config.�
*A:>edit-cfg>config>system>security>tacplus#
DEBUG:netmiko:Pattern found: candidate\ edit candidate edit
INFO: CLI There are uncommitted changes in the candidate config.�
*A:>edit-cfg>config>system>security>tacplus#
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:read_channel:
*A:>edit-cfg>config>system>security>tacplus#
DEBUG:netmiko:read_channel:
DEBUG:netmiko:[find_prompt()]: prompt is *A:NWBY-PX-A1>edit-cfg>config>system>security>tacplus#
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'candidate discard\n'
DEBUG:netmiko:Pattern is: candidate\ discard
DEBUG:netmiko:_read_channel_expect read_data: cand
DEBUG:netmiko:_read_channel_expect read_data: idate discard
WARNING: This action is irreversible. Are you sure you want to proceed (y/n)?
DEBUG:netmiko:Pattern found: candidate\ discard candidate discard
WARNING: This action is irreversible. Are you sure you want to proceed (y/n)?
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
Successful Output
DEBUG:netmiko:write_channel: b'environment no more\n'
DEBUG:netmiko:Pattern is: environment\ no\ more
DEBUG:netmiko:_read_channel_expect read_data: envir
DEBUG:netmiko:_read_channel_expect read_data: onment no more
*A:#
DEBUG:netmiko:Pattern found: environment\ no\ more environment no more
*A:#
DEBUG:netmiko:environment no more
*A:#
DEBUG:netmiko:Exiting disable_paging
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'candidate edit\n'
DEBUG:netmiko:send_command_timing current output:
DEBUG:netmiko:read_channel: candidate edit
INFO: CLI There are uncommitted changes in the candidate config.�
*A:>edit-cfg>config>system>security>tacplus#
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:send_command_timing final output: candidate edit
INFO: CLI There are uncommitted changes in the candidate config.�
*A:>edit-cfg>config>system>security>tacplus#
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'candidate discard\n'
DEBUG:netmiko:send_command_timing current output:
DEBUG:netmiko:read_channel: candidate discard
WARNING: This action is irreversible. Are you sure you want to proceed (y/n)?
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:send_command_timing final output: candidate discard
WARNING: This action is irreversible. Are you sure you want to proceed (y/n)?
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'y\n'
DEBUG:netmiko:send_command_timing current output:
DEBUG:netmiko:read_channel: y
*A:>config>system>security>tacplus#
*A:>config>system>security>tacplus#
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:send_command_timing final output: y
*A:>config>system>security>tacplus#
*A:>config>system>security>tacplus#
Beta Was this translation helpful? Give feedback.
All reactions