You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The commit command is an interactive command and the code tries to handle the situation where other commits have occurred during the configuration session. However send_command_expect is used instead of send_command_timing and therefore the code to handle the alt_error_marker is never reached.
I propose to change output += self.send_command_expect( into output += self.send_command_timing( of the following section of cisco_xr.py.
# Enter config mode (if necessary)output=self.config_mode()
output+=self.send_command_expect(
command_string,
strip_prompt=False,
strip_command=False,
delay_factor=delay_factor,
)
iferror_markerinoutput:
raiseValueError(f"Commit failed with the following errors:\n\n{output}")
ifalt_error_markerinoutput:
# Other commits occurred, don't proceed with commitoutput+=self.send_command_timing(
"no", strip_prompt=False, strip_command=False, delay_factor=delay_factor
)
raiseValueError(f"Commit failed with the following errors:\n\n{output}")
Before the proposed change, netmiko incorrectly raises NetmikoTimeoutException with message Timed-out reading channel, pattern not found in output. After the proposed change, netmiko correctly raises ValueError with message Commit failed with the following errors:.
Thanks,
Tim
The text was updated successfully, but these errors were encountered:
We should also add a test case for this into our IOS-XR tests. I am probably only testing the normal case where there are no other pending commits (I am assuming this is why my standard commit tests on IOS-XR are working properly).
The commit command is an interactive command and the code tries to handle the situation where other commits have occurred during the configuration session. However send_command_expect is used instead of send_command_timing and therefore the code to handle the alt_error_marker is never reached.
I propose to change
output += self.send_command_expect(
intooutput += self.send_command_timing(
of the following section of cisco_xr.py.Before the proposed change, netmiko incorrectly raises
NetmikoTimeoutException
with messageTimed-out reading channel, pattern not found in output
. After the proposed change, netmiko correctly raisesValueError
with messageCommit failed with the following errors:
.Thanks,
Tim
The text was updated successfully, but these errors were encountered: