Open FriendlyGecko opened 7 months ago
Just opened #3441 and looks like it might be the same issue, except my Issue is on NXOS.
@fisherbe @FriendlyGecko What does your MOTD look like?
@fisherbe Are you using SSH for transport or something else (original problem was using "serial" connection i.e. console cable or similar)?
@ktbyers ,
For my #3441 ,
Default motd: "User Access Verification"
Using SSH, not serial or telnet.
@FriendlyGecko What does your MOTD look like?
banner motd '
test test test'
Are you using SSH for transport or something else (original problem was using "serial" connection i.e. console cable or similar)? I ran into the issue with both SSH and serial connections. I realize I wasn't explicit enough with "[OPTIONAL] Configure SSH"
@FriendlyGecko I don't see any issue when using SSH for this on Cisco IOS/IOS-XE
cisco3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
cisco3(config)#banner motd '
Enter TEXT message. End with the character '''.
test test test'
cisco3(config)#end
cisco3#exit
Connection to cisco3.lasthop.io closed by remote host.
Connection to cisco3.lasthop.io closed.
[.venv] ktbyers@pydev2 ~/netmiko/tests
$ ssh -l pyclass cisco3.lasthop.io
Password:
test test test
cisco3#exit
Connection to cisco3.lasthop.io closed by remote host.
Connection to cisco3.lasthop.io closed.
$ py.test -s -v -x test_netmiko_show.py --test_device cisco3
========================================================== test session starts ===========================================================
platform linux -- Python 3.10.2, pytest-8.2.2, pluggy-1.5.0 -- /home/ktbyers/netmiko/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/ktbyers/netmiko
configfile: setup.cfg
plugins: pylama-8.4.1
collected 25 items
test_netmiko_show.py::test_failed_key SKIPPED (Not using SSH-keys)
test_netmiko_show.py::test_disable_paging PASSED
test_netmiko_show.py::test_terminal_width PASSED
test_netmiko_show.py::test_ssh_connect PASSED
test_netmiko_show.py::test_ssh_connect_cm PASSED
test_netmiko_show.py::test_send_command_timing PASSED
test_netmiko_show.py::test_send_command_timing_no_cmd_verify SKIPPED
test_netmiko_show.py::test_send_command PASSED
test_netmiko_show.py::test_send_command_no_cmd_verify SKIPPED
test_netmiko_show.py::test_complete_on_space_disabled SKIPPED
test_netmiko_show.py::test_send_command_textfsm PASSED
test_netmiko_show.py::test_send_command_ttp SKIPPED (TTP template not existing for this platform)
test_netmiko_show.py::test_send_command_genie PASSED
test_netmiko_show.py::test_send_multiline_timing PASSED
test_netmiko_show.py::test_send_multiline PASSED
test_netmiko_show.py::test_send_multiline_prompt PASSED
test_netmiko_show.py::test_send_multiline_simple PASSED
test_netmiko_show.py::test_base_prompt PASSED
test_netmiko_show.py::test_strip_prompt PASSED
test_netmiko_show.py::test_strip_command PASSED
test_netmiko_show.py::test_normalize_linefeeds PASSED
test_netmiko_show.py::test_clear_buffer PASSED
test_netmiko_show.py::test_enable_mode PASSED
test_netmiko_show.py::test_disconnect PASSED
test_netmiko_show.py::test_disconnect_no_enable SKIPPED
Can you reproduce your error using SSH and post the full exception stack here?
The NX-OS item is a different issue related to a null password which is covered in the linked issue:
Yeah, I was working on this issue in my pull request. It has been a good while since I had worked on it and the environment that I am using now does not appear to have the same issue. When I have access to the same lab, then I will troubleshoot it again.
I am not concerned with #3441.
Description of Issue/Question
When attempting to log into a device that uses a MOTD, the login fails. This is because the MOTD requires the user to first send a return character to wake it up. If I use putty to first console in and press enter, I can swap back to my netmiko script and log into the device.
Setup
1 Laptop 1 Console Cable 1 Network
Netmiko version
Netmiko device_type (if relevant to the issue)
Steps to Reproduce the Issue
Error Traceback
Relevant Python code
Potential Fix
I tried something similar to this but had no success. If I figure out a good answer that is flexible enough for majority use, then I will attempt to merge it. EDIT: I was inputting this change in base_connection and not cisco_base_connection