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
I am writing to request clarification of the stub special_login_handler function, which currently has just this:
def special_login_handler(self, delay_factor: float = 1.0) -> None:
"""Handler for devices like WLC, Extreme ERS that throw up characters prior to login."""
pass
Netmiko version
Latest - tip of branch develop
Request
As far as I can understand, SSH authentication has already happened before the special_login_handler function defined in https://github.com/ktbyers/netmiko/blob/develop/netmiko/base_connection.py is called. I speculate that the function's purpose is to consume extra text after authentication is complete and before the first prompt is shown, to help Netmiko to discover the command-line prompt reliably. If that's correct, then I think the pydoc maybe should be something like this:
"""
Handler for devices like WLC, Extreme ERS that throw up characters
after authentication is complete and before displaying a prompt.
"""
A common case where special_login_handler is needed is when a device uses a non-standard SSH login (i.e. where you need to bypass normal SSH authentication mechanisms and have Netmiko handle it directly). Examples of this being the cisco_s200, and calix_b6 drivers.
Consequently, I think this description would be misleading/confusing:
Handler for devices like WLC, Extreme ERS that throw up characters
after authentication is complete and before displaying a prompt.
As authentication might not have taken place (i.e. netmiko is handling the authentication process). Note, there is ambiguity in the meaning of authentication as you have Paramiko "authentication" and you have the actual "authentication" (i.e. logging into the device with username and password). I think the latter of these two is the more common-sense meaning.
I open to other naming/docstrings, but we shouldn't refer to authentication is complete (as it very likely won't be).
Thank you for the quick reply and explanation! I think you have reinforced my opinion that the pydoc on that function needs a few more words :) I'm not sure I got the sense of "authentication" quite right, but how about possibly:
Handler for devices like WLC, Extreme ERS that require Netmiko to handle the authentication process
because the normal Paramiko secure shell authentication process does not work.
Description of Issue/Question
I am writing to request clarification of the stub
special_login_handler
function, which currently has just this:Netmiko version
Latest - tip of branch
develop
Request
As far as I can understand, SSH authentication has already happened before the
special_login_handler function
defined in https://github.com/ktbyers/netmiko/blob/develop/netmiko/base_connection.py is called. I speculate that the function's purpose is to consume extra text after authentication is complete and before the first prompt is shown, to help Netmiko to discover the command-line prompt reliably. If that's correct, then I think the pydoc maybe should be something like this:With all that said, I see in https://github.com/ktbyers/netmiko/blob/develop/netmiko/dell/dell_powerconnect.py#L87 that a
SSHClient_noauth
client is installed, and thespecial_login_handler
function seems to be responsible for authentication. If that's right, I'll propose a much better Pydoc.Please comment, thanks for your time.
p.s. this is my way of asking, do I really need a custom SSHClient for Paramiko to cope with an unusual SSH authentication procedure.
The text was updated successfully, but these errors were encountered: